Community
Participate
Working Groups
Build ID: M20071023-1652 Steps To Reproduce: ------------------- 1. Unzip the project in the zip file 2. Toggle the comment on line 38: final //Object.... 3. Watch the Exceptions appear in the error log More information: ----------------- I tried to trim the test case down further, but if I remove the code in the last 'if (false)' block (lines 58-69) the problem goes away. The problem is completely reproducible. Stack Trace: ------------ java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2609) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:483) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:318) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2283) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1537) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2476) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:511) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:179) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2661) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1248) at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:255) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:892) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:651) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:609) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:602) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:514) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:155) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:140) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Created attachment 84881 [details] Test case for bug. Attachment failed when creating bug
Cannot reproduce using I20080304-1113. Could you please check again?
Agreed. Problem doesn't seem reproducible in Eclipse 3.4.0 - I20080207-1530. Are the changes necessary to fix this going to be back ported to 3.3.1?
Reproduced with 3.3.2. A fix should be investigated for post 3.3.2 builds. Since this is related to code recovery, I reassign to David.
The problem can be reproduced in 3.3.2 and not in 3.4. The smallest test case to reproduce the bug is: public class Junk { public void foo() { new Object() { public void bar() { if (true) { final } } }; if (false) { Object var = new Object() { void toto() { } }; } } }
As the problem is already fixed in 3.4, i close this bug as WORKSFORME. I added a regression test ASTConverterBugsTest#testBug212434a()
Verified for 3.4M6 using I20080325-0100