Bug 79362 - IllegalArgumentException during "Java AST creation"
Summary: IllegalArgumentException during "Java AST creation"
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-23 21:05 EST by Dave Latham CLA
Modified: 2004-12-14 12:08 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Latham CLA 2004-11-23 21:05:03 EST
Eclipse Build: I200411230838
JVM: Sun 1.5.0-rc

I'm getting the following error.  I've managed to confuse myself while trying to
get rid of it about why it's happening, so am unsure what steps are necessary to
reproduce.  Hopefully a stack trace will be enough:

java.lang.IllegalArgumentException
at org.eclipse.jdt.core.dom.ASTNode.setSourceRange(ASTNode.java:2583)
at
org.eclipse.jdt.core.dom.ASTConverter.updateInnerPositions(ASTConverter.java:4937)
at org.eclipse.jdt.core.dom.ASTConverter.setTypeForField(ASTConverter.java:4741)
at
org.eclipse.jdt.core.dom.ASTConverter.convertToFieldDeclaration(ASTConverter.java:2759)
at
org.eclipse.jdt.core.dom.ASTConverter.checkAndAddMultipleFieldDeclaration(ASTConverter.java:514)
at
org.eclipse.jdt.core.dom.ASTConverter.buildBodyDeclarations(ASTConverter.java:444)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2547)
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1297)
at
org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:211)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:729)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:574)
at
org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:565)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:494)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:165)
at
org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:142)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

Let me know if I need to spend a while to isolate a reproducible case.
Comment 1 Olivier Thomann CLA 2004-11-23 21:33:41 EST
Could you please provide the compilation unit that you were editing when this
happened?
Of course it would be great if you could isolate a reproducable test case. This
would definitely help us to fix it.
Comment 2 Dave Latham CLA 2004-11-23 21:59:37 EST
Ok, I narrowed it down to a bit of code that I now realize is probably illegal
Generics usage:

public class ASTError
{
    private Map<String, Double>[][] fScoreTable = new Map[10];
}
Comment 3 Olivier Thomann CLA 2004-11-23 22:44:52 EST
Even if the code is illegal, the converter should not blow up. I will investigate.
Comment 4 Olivier Thomann CLA 2004-11-24 12:14:44 EST
Reproduced. I am working on it.
Comment 5 Olivier Thomann CLA 2004-11-24 17:17:23 EST
Fixed and released in HEAD.
Regression tests added in ASTConverter15Test.test0076 and test0077.
Comment 6 Jerome Lanneluc CLA 2004-12-14 12:08:20 EST
Verified (in I200412140800) that the test ensures that the source in comment #2
can be parsed and that an AST can be created from it.