Community
Participate
Working Groups
I download M7 and noticed an error with ASTParser. Here is the code: ASTParser parser = ASTParser.newParser(AST.JLS3); parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS); parser.setSource("private static Category[] values = new Category[]{v1, v2, v3};".toCharArray()); ASTNode root = (ASTNode) parser.createAST(null); It gives the following exception: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2583) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:769) at org.eclipse.jdt.core.dom.ASTConverter.convert (ASTConverter.java:1443) at org.eclipse.jdt.core.dom.ASTConverter.convertToVariableDeclarationFragment (ASTConverter.java:2789) at org.eclipse.jdt.core.dom.ASTConverter.convertToFieldDeclaration (ASTConverter.java:2692) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:874) at org.eclipse.jdt.core.dom.ASTParser.internalCreateASTForKind (ASTParser.java:949) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST (ASTParser.java:716) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:570)
Fixed and released in HEAD. Regression test in org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2.test607.
Verified for 3.1 RC1 with build I20050527-0010.