Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In generic types, annotations are removed and the annotated type parameter becomes fully qualified, when moving the annotated type to another package #1887

Open
pewe2024 opened this issue Dec 26, 2024 · 0 comments

Comments

@pewe2024
Copy link

pewe2024 commented Dec 26, 2024

The following bug exists in Eclipse IDE 2024-12 (as well as in older versions of the Eclipse IDE):

If you have the Java class

public class Test
{
    public List<@Annotation MovedType> list;
}

and you move the type MovedType to another package, the @Annotation is removed and the type parameter MovedType becomes fully qualified.

The class will look like that, afterwards:

public class Test
{
    public List<destinationpackage.MovedType> list;
}

Instead, only the import for MovedType (which is omitted here) should change.

The attached file

TestProject.zip

contains an eclipse project, that can be used to reproduce the error.

If you move the contained file TestProject/src/sourcepackage/MovedType.java by either dragging and dropping it to TestProject/src/destinationpackage or by using Refactor -> Move..., the file TestProject/src/staticpackage/Test.java will show the error.

@pewe2024 pewe2024 changed the title In generic types, annotations are removed and the annotated type becomes fully qualified, when moving the annotated type to another package In generic types, annotations are removed and the annotated type parameter becomes fully qualified, when moving the annotated type to another package Dec 26, 2024
@srikanth-sankaran srikanth-sankaran transferred this issue from eclipse-jdt/eclipse.jdt.core Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant