alfasoftware / astra

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

TypeReferenceRefactor does not properly handle fully qualified names in Javadoc links #3

Closed RadikalJin closed 3 years ago

RadikalJin commented 3 years ago

A TypeReferenceRefactor from org.alfasoftware.astra.exampleTypes.A to org.alfasoftware.astra.exampleTypes.B should update all references. Currently, only simple type name references in Javadoc @link tags are updated. It should also cover fully qualified references, as in this example:

Before After
/**
 * {@link org.alfasoftware.astra.exampleTypes.A}
 */
public class Example {
}
/**
 * {@link org.alfasoftware.astra.exampleTypes.B}
 */
public class Example {
}

A fully qualified import like this should be added to TypeReferenceExample and TypeReferenceExampleAfter, the examples used for TestTypeReferenceRefactor#testChangeTypes.

It's likely that there is a mistake in the TypeReferenceRefactor at around line 117, debugging at this point while running the test will likely show why we don't reach this block.

10wonga commented 3 years ago

link in issue leads to line 177, not 117 which is an empty line. Will assume this refers to line 177.

RadikalJin commented 3 years ago

Fixed by @10wonga in #57.