Community
Participate
Working Groups
Build 200404281424. I was working on some code inside an inner class, and I cut/pasted into the main class, and this error message came up in an error box. Once I closed the error box, it kept reappearing, and I had to shut down Eclipse. !MESSAGE An internal error occurred during: "Java AST creation". !STACK 0 java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2587) at org.eclipse.jdt.core.dom.ASTConverter.convertToVariableDeclarationFragment(ASTConverter.java:2676) at org.eclipse.jdt.core.dom.ASTConverter.convertToFieldDeclaration(ASTConverter.java:2721) at org.eclipse.jdt.core.dom.ASTConverter.checkAndAddMultipleFieldDeclaration(ASTConverter.java:367) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:327) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:271) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:149) at org.eclipse.jdt.core.dom.ASTParser.convert(ASTParser.java:707) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:677) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:573) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:437) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:389) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:123) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$1.run(SelectionListenerWithASTManager.java:101) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
Could you please attach to this PR the source of the class you paste? I need to investigate asap.
Created attachment 10175 [details] The class that caused the error Here is a zip of the java file exactly as it was when the error occured. The second time I was able to reproduce I simply had to paste the second set of }}}; below the private PropertyChangeListener stackListener = new PropertyChangeListener() { line.
Reproduced. It seems to be a problem with positions and syntax errors in code.
We are in a case a field declaration has no declaration end and no declaration source end. There are two ways to fix it: 1) close the field declaration inside the updateOnClosingBrace(...) 2) close the field declaration inside the updatedFieldDeclaration()
I patch this problem. David, could you please double-check my change in: RecoveredField#updateOnClosingBrace(int, int)? Thanks.
David, I added regression tests in ASTConverterTest2.
Fix seems good for me Fixed.
Verified in 200405180816