Community
Participate
Working Groups
What steps will reproduce the problem? 1. I had a java source class that had, right after the class declaration line ("public class ...") a bunch of lines (10 line long) of // commented lines 2. Selected the range, and did source/toggle comment 3. the error log was flooding (non-stop) with errors (shown below), until I re-commented the block (Add Block Comment) -- Error Details -- Date: Wed Sep 23 11:19:36 EDT 2009 Message: Error in JDT Core during AST creation Severity: Error Product: Eclipse 1.2.0.20090615-0858 (org.eclipse.epp.package.rcp.product) Plugin: org.eclipse.jdt.ui Session Data: eclipse.buildId=I20090611-1540 java.version=1.6.0_16 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.rcp.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.rcp.product Exception Stack Trace: java.lang.IllegalArgumentException at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2614) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:430) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:179) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2694) at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:184) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2694) at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1264) at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:256) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:933) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:657) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:544) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:537) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:478) at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:126) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.getOverrideIndicators(OverrideIndicatorLabelDecorator.java:161) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.computeAdornmentFlags(OverrideIndicatorLabelDecorator.java:136) at org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator.decorate(OverrideIndicatorLabelDecorator.java:272) at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:269) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365) at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371) at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Could you please provide the source of the class once the comments are removed (after step 2)? Somehow we end up with some nodes that are not properly closed. The test case is required for further investigation.
Reducing severity as required test case has not been provided yet.
oops. it's long gone... I was concerned with stopping the error log flood and then filed the bug, didn't think of providing the contents of the editor then (besides, the code is proprietary :-( )
Without a test case, this will be closed as WORKSFORME. The problem comes from the error recovery. So you must have some code that doesn't compile and you end up with some nodes that are not properly closed (no end position set). If I don't have the exact test case, there is no way I can investigate it. So please consider making changes to the code so that you can provide it otherwise the problem won't be fixed.
I understand. If I find myself able, I'll get you a test case.
Ok, thanks Eddie. Closing as WORKSFORME. Please reopen once the test case is provided.
Verified for 3.6M3 using build I20091025-2000.