Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 525431

Summary: IAE in ASTNode.setSourceRange below SharedASTProvider.getAST
Product: [Eclipse Project] JDT Reporter: Andreas Sewe <sewe>
Component: CoreAssignee: Manoj N Palat <manoj.palat>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, stephan.herrmann
Version: 4.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Andreas Sewe CLA 2017-10-02 03:21:57 EDT
Hi JDT team,

I recently received an error report for one of our tools (which builds upon JDT) through automated error reporting. Like Bug 460186, we simply create an AST through a straight-up call to 

  SharedASTProvider.getAST(typeRoot, SharedASTProvider.WAIT_YES, progress.newChild(1));

but the stack trace looks sufficiently different so not to make this an obvious duplicate:

Bundle: org.eclipse.jdt.core 3.11.2.xx-201708152349-e45
Message: source file contents removed
Exception:
java.lang.IllegalArgumentException: null
    at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2845)
    at org.eclipse.jdt.core.dom.ASTConverter.setTypeAnnotationsAndSourceRangeOnArray(ASTConverter.java:3499)
    at org.eclipse.jdt.core.dom.ASTConverter.convertToArray(ASTConverter.java:3230)
    at org.eclipse.jdt.core.dom.ASTConverter.convertType(ASTConverter.java:3714)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1376)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1771)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2221)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1834)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2694)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2765)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:682)
    at org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:205)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:3016)
    at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1428)
    at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:301)
    at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1216)
    at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:812)
    at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:535)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:528)
    at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:471)
    at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:128)
    at com.codetrails.codesearch.workspace.rcp.AbstractIndexingJob.a(AbstractIndexingJob.java:393)
    at com.codetrails.codesearch.workspace.rcp.AbstractIndexingJob.indexTypeRoot(AbstractIndexingJob.java:358)
    at com.codetrails.codesearch.workspace.rcp.AbstractIndexingJob.b(AbstractIndexingJob.java:341)
    at com.codetrails.codesearch.workspace.rcp.AbstractIndexingJob.a(AbstractIndexingJob.java:322)
    at com.codetrails.codesearch.workspace.rcp.AbstractIndexingJob.a(AbstractIndexingJob.java:302)
    at com.codetrails.codesearch.workspace.rcp.AbstractIndexingJob$IndexPackageCallable.call(AbstractIndexingJob.java:570)
    at com.codetrails.codesearch.workspace.rcp.AbstractIndexingJob$IndexPackageCallable.call(AbstractIndexingJob.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

I unfortunately cannot give you much more information than that, besides the following version info:

- org.eclipse.jdt.core 3.11.2.xx-201708152349-e45
- org.eclipse.jdt.ui 3.11.2.v20151123-1510

- org.eclipse.epp.package.java.product 4.5.2.M20160212-1500

The version is, of course, pre-Neon, so this issue might have indeed be fixed with Bug 460186, but as I said, the stacktraces are quite different.
Comment 1 Stephan Herrmann CLA 2017-10-03 11:35:49 EDT
(In reply to Andreas Sewe from comment #0)
> I unfortunately cannot give you much more information than that, besides the
> following version info:
> 
> - org.eclipse.jdt.core 3.11.2.xx-201708152349-e45
> - org.eclipse.jdt.ui 3.11.2.v20151123-1510
> 
> - org.eclipse.epp.package.java.product 4.5.2.M20160212-1500

Looks like s.o. installed a recent STS over an older original Eclipse package.

o.e.jdt.core is not in a version that is produced by JDT, nor does this version seem to be compatible with the installed version of o.e.jdt.ui.

> The version is, of course, pre-Neon, so this issue might have indeed be fixed
> with Bug 460186, but as I said, the stacktraces are quite different.

Different line numbers _could_ be an effect of the modifications done by the Spring team (assumably: groovy-eclipse).

Ideally, the reporter should tell whether the problem can be reproduced with original and consistent versions of jdt plug-ins.
Comment 2 Eclipse Genie CLA 2019-10-07 03:56:54 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.