alfasoftware / astra

Astra: a Java tool for analysing and refactoring Java source code
Apache License 2.0
68 stars 35 forks source link

Type reference refactor improvements to handling imports for annotations which are inner types #81

Closed RadikalJin closed 2 years ago

RadikalJin commented 2 years ago

Describe the bug When an annotation is refactored with the type reference refactor, and the annotation is an inner type, the import is changed as though the import was a top level type.

To Reproduce See unit test TestTypeReferenceRefactor#testChangeInnerTypeAnnotation.

Expected behavior The import should reflect that the annotation is an inner type, e.g. import org.alfasoftware.astra.exampleTypes.A.InnerAnnotationA rather than import org.alfasoftware.astra.exampleTypes.InnerAnnotationA

Additional context A similar issue affects AnnotationsRefactor - see TestAnnotationsRefactor#testAnnotationInnerTypeChange

RadikalJin commented 2 years ago

Fixed by #82