Bug 424164 - [1.8][dom ast] strange AST node range problem with reconciler
Summary: [1.8][dom ast] strange AST node range problem with reconciler
Status: RESOLVED DUPLICATE of bug 419829
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: BETA J8   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-16 13:06 EST by Markus Keller CLA
Modified: 2014-02-03 02:48 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2013-12-16 13:06:17 EST
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)
Comment 1 Srikanth Sankaran CLA 2014-01-06 09:52:47 EST
Looks same as bug 416560. Will add a note there to make sure this test case
is also added to junits.
Comment 2 Srikanth Sankaran CLA 2014-01-06 09:53:04 EST

*** This bug has been marked as a duplicate of bug 416560 ***
Comment 3 Srikanth Sankaran CLA 2014-02-03 02:48:37 EST
retagging as duplicate of bug 419829

*** This bug has been marked as a duplicate of bug 419829 ***