Community
Participate
Working Groups
I ran into a strange temporary AST node range problem with the reconciler AST when the org.eclipse.jdt.core/debug/dom/ast debug tracing option is set to true. Could be related to bug 423584, which also shows up for this AST. I can't reproduce reliably, but it happens in more than 50% of my attempts. Steps: - create snippet: public class Snippet { { // a // few // comments // here foo((int x) -> 9); } } - save the editor - put caret after 9 - press backspace once - press 1 (or any other digit) => an AST with a bad source range for the lambda parameter declaration is created: !ENTRY org.eclipse.jdt.core 4 4 2013-12-16 18:52:51.610 !MESSAGE Bad AST node structure: - parent [121, 133] org.eclipse.jdt.core.dom.LambdaExpression parameters [39, 127] org.eclipse.jdt.core.dom.SingleVariableDeclaration ----------------------------------- SOURCE BEGIN ------------------------------------- public class Snippet { { // a // few // comments // here foo((int x) -> 1); } } ----------------------------------- SOURCE END ------------------------------------- !STACK 0 java.lang.IllegalStateException: Bad AST node structure at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1419) at org.eclipse.jdt.core.dom.AST.convertCompilationUnit(AST.java:273) at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:203) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:521) at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:1082) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:170) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1247) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151) at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:104) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
Looks same as bug 416560. Will add a note there to make sure this test case is also added to junits.
*** This bug has been marked as a duplicate of bug 416560 ***
retagging as duplicate of bug 419829 *** This bug has been marked as a duplicate of bug 419829 ***