AutoRefactor
AutoRefactor copied to clipboard
Attach line comments on fields to existing javadocs
Given
The following code:
/** javadoc **/
private static final String REGEX = ".*"; // line comment 1
// line comment 2
private static final String FIELD = "bla";
When
automated refactoring are applied
Then
Expected:
/**
* javadoc
* line comment 1
*/
private static final String REGEX = ".*";
/** line comment 2 */
private static final String FIELD = "bla";
Actual:
/** Javadoc. */
private static final String REGEX = ".*"; /** Line comment 1 line comment 2. */
private static final String FIELD = "bla";
Note how "line comment 1" is attached to the existing javadoc rather than added as a javadoc of FIELD.
Also test what happens when javadoc is replaced by a block comment in the example above, i.e.:
/* block comment **/
private static final String REGEX = ".*"; // line comment 1
// line comment 2
private static final String FIELD = "bla";