Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16554,4 +16554,21 @@ record X<T>(T value) {
""";
formatSource(input, expected);
}

public void testEnumJavaDocBreak() throws JavaModelException {
setComplianceLevel(CompilerOptions.VERSION_23);
String input = """
public enum TestEnum {
/// A
A;
}
""";
String expected = """
public enum TestEnum {
/// A
A;
}
""";
formatSource(input, expected);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public boolean visit(EnumDeclaration node) {
for (int i = 0; i < enumConstants.size(); i++) {
EnumConstantDeclaration declaration = enumConstants.get(i);
if (declaration.getJavadoc() != null)
this.tm.firstTokenIn(declaration, TokenNameCOMMENT_JAVADOC).breakBefore();
this.tm.firstTokenIn(declaration.getJavadoc(), ANY).breakBefore();
if (declaration.getAnonymousClassDeclaration() != null && i < enumConstants.size() - 1)
this.tm.firstTokenAfter(declaration, TokenNameCOMMA).breakAfter();
}
Expand Down
Loading