Summary: | [ast rewrite] 'Document does not match the AST' for quick fix on recovered AST | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | David Audel <david_audel> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | martinae, Olivier_Thomann |
Version: | 3.2 | ||
Target Milestone: | 3.5 M1 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: | |||
Bug Depends on: | 239117 | ||
Bug Blocks: |
Description
Markus Keller
2006-07-28 19:42:04 EDT
When I change the method body to if (1==1 && var.equals(1) { m(1); } and the do the same, I get this AFE: org.eclipse.jface.text.Assert$AssertionFailedException: Assertion failed: at org.eclipse.jface.text.Assert.isTrue(Assert.java:188) at org.eclipse.jface.text.Assert.isTrue(Assert.java:173) at org.eclipse.text.edits.TextEdit.<init>(TextEdit.java:145) at org.eclipse.text.edits.DeleteEdit.<init>(DeleteEdit.java:33) at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doTextRemove(ASTRewriteAnalyzer.java:270) at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.doTextRemoveAndVisit(ASTRewriteAnalyzer.java:279) at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.rewriteBodyNode(ASTRewriteAnalyzer.java:684) at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:2092) at org.eclipse.jdt.core.dom.IfStatement.accept0(IfStatement.java:185) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2466) at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:255) at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:244) at org.eclipse.jdt.internal.ui.text.correction.ASTRewriteCorrectionProposal.addEdits(ASTRewriteCorrectionProposal.java:93) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.createTextChange(CUCorrectionProposal.java:294) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.createChange(CUCorrectionProposal.java:303) at org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal.getChange(ChangeCorrectionProposal.java:207) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getTextChange(CUCorrectionProposal.java:313) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.getAdditionalProposalInfo(CUCorrectionProposal.java:131) at org.eclipse.jface.text.contentassist.AdditionalInfoController$6.run(AdditionalInfoController.java:162) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) ... 20 more David, Is DOM/AST statement recovering involved in this case or is it a specific ASTRewrite issue? Looks like an ast rewrite issue. I added an extra check for the closing parent. However, the example still doesn't work as the AST contains overlapping source ranges. I filed bug 239117. Works fine for me with the fix for bug 239117. Verified for 3.5M1 using I20080805-1307. I don't get the same proposal, but it doesn't crash anymore. |