Skip to content

Commit

Permalink
Partial fix for ASTConverter15JLS8Test.test0027 - EnumConstantDeclara…
Browse files Browse the repository at this point in the history
…tion missing arguments

Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed May 3, 2024
1 parent 46ca67d commit 630f569
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2362,12 +2362,23 @@ private EnumConstantDeclaration convertEnumConstantDeclaration(JCTree var, ASTNo
enumConstantDeclaration.setSourceRange(start, end-start);
enumConstantDeclaration.setName(typeName);
}
if( enumConstant.init instanceof JCNewClass jcnc && jcnc.def instanceof JCClassDecl jccd) {
AnonymousClassDeclaration e = createAnonymousClassDeclaration(jccd, enumConstantDeclaration);
if( e != null ) {
enumConstantDeclaration.setAnonymousClassDeclaration(e);
if( enumConstant.init instanceof JCNewClass jcnc ) {
if( jcnc.def instanceof JCClassDecl jccd) {
AnonymousClassDeclaration e = createAnonymousClassDeclaration(jccd, enumConstantDeclaration);
if( e != null ) {
enumConstantDeclaration.setAnonymousClassDeclaration(e);
}
}
}
if( jcnc.getArguments() != null ) {
Iterator<JCExpression> it = jcnc.getArguments().iterator();
while(it.hasNext()) {
Expression e = convertExpression(it.next());
if( e != null ) {
enumConstantDeclaration.arguments().add(e);
}
}
}
}
}
}
return enumConstantDeclaration;
Expand Down

0 comments on commit 630f569

Please sign in to comment.