diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java index 524354c2473..dfe22c0fb24 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java @@ -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 it = jcnc.getArguments().iterator(); + while(it.hasNext()) { + Expression e = convertExpression(it.next()); + if( e != null ) { + enumConstantDeclaration.arguments().add(e); + } + } + } + } } } return enumConstantDeclaration;