Skip to content

Commit

Permalink
Regression in ASTConverter15JLS8Test.test0006 - 0-arg marker annotati…
Browse files Browse the repository at this point in the history
…ons with parenthesis handled incorrectly

Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed May 3, 2024
1 parent 83a66bf commit 5a8d8fd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,11 @@ private Code convert(TypeKind javac) {
}

private Annotation convert(JCAnnotation javac) {
if( javac.getArguments().size() == 0) {
int startPos = javac.getStartPosition();
int length = javac.getEndPosition(this.javacCompilationUnit.endPositions) - startPos;
String content = this.rawText.substring(startPos, startPos+length);
boolean mustUseNormalAnnot = content != null && content.contains("(");
if( javac.getArguments().size() == 0 && !mustUseNormalAnnot) {
MarkerAnnotation res = this.ast.newMarkerAnnotation();
commonSettings(res, javac);
res.setTypeName(toName(javac.getAnnotationType()));
Expand Down

0 comments on commit 5a8d8fd

Please sign in to comment.