Bug 126347 - AIOOBE in CompilerUnitScope
Summary: AIOOBE in CompilerUnitScope
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-03 10:19 EST by Frederic Fusier CLA
Modified: 2006-02-15 09:19 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 Frederic Fusier CLA 2006-02-03 10:19:18 EST
Using test case of bug 126332, I put a breakpoint on AIOOBE and surprisingly stopped in CompilationUnitScope with following stack trace:
CompilationUnitScope.findImport(char[][], int) line: 423
CompilationUnitScope.getImport(char[][], boolean, boolean) line: 548
DefaultBindingResolver.resolveName(Name) line: 1060
SimpleName(Name).resolveBinding() line: 86
SemanticToken.getBinding() line: 44
SemanticHighlightings$DeprecatedMemberHighlighting.getMethodBinding(SemanticToken) line: 1135
SemanticHighlightings$DeprecatedMemberHighlighting.consumes(SemanticToken) line: 1108
SemanticHighlightingReconciler$PositionCollector.visit(SimpleName) line: 120
SimpleName.accept0(ASTVisitor) line: 147
SimpleName(ASTNode).accept(ASTVisitor) line: 2466
ImportDeclaration(ASTNode).acceptChild(ASTVisitor, ASTNode) line: 2513
ImportDeclaration.accept0(ASTVisitor) line: 221
ImportDeclaration(ASTNode).accept(ASTVisitor) line: 2466
CompilationUnit(ASTNode).acceptChildren(ASTVisitor, ASTNode$NodeList) line: 2536
CompilationUnit.accept0(ASTVisitor) line: 211
CompilationUnit(ASTNode).accept(ASTVisitor) line: 2466

Looking at variables, it seems that compoundName parameter of CompilationUnitScope.getImport(char[][], boolean, boolean) was an unexpected empty array which raises this exception on "compoundName[0]" of CompilationUnitScope.findImport(char[][], int)

Perhaps DefaultBindingResolver.resolveName should not call CompilationUnitScope.getImport method when index is == 0?
Comment 1 Olivier Thomann CLA 2006-02-03 10:20:58 EST
I will investigate.
Comment 2 Frederic Fusier CLA 2006-02-03 10:22:59 EST
Sorry I forgot to mention that I got this exception while editing V.java...
Comment 3 Olivier Thomann CLA 2006-02-03 14:03:35 EST
Could not reproduce.
Comment 4 Frederic Fusier CLA 2006-02-05 05:20:20 EST
I get it systematically using following scenario:
1) Create a launch config starting eclipse on a brand new workspace
2) Unzip project attached to bug 126332 at this workspace location
3) Import unzipped project in this workspace
4) Set compiler settings to 5.0 and add JRE 1.5.0 as default
   => you'll get no longer compiler error
5) Put a breakpoint on ArrayIndexOutOfBoundException and restrict it by excluding
   Scanner and PublicScanner
6) Expand project in Package Explorer and in test package double-click on V.java
7) Wait a few seconds and you should hit the breakpoint in debugger perspective...
Comment 5 Olivier Thomann CLA 2006-02-06 11:23:41 EST
Reproduced.
Fixed and released in HEAD.
Regression test in org.eclipse.jdt.core.tests.dom.ASTConverter15Test.test0209
Comment 6 David Audel CLA 2006-02-15 09:19:54 EST
Verified for 3.2 M5 using build I20060215-0010