Bug 285845 - ArrayIndexOfBoundException on lookup.MethodBinding.collectMissingTypes
Summary: ArrayIndexOfBoundException on lookup.MethodBinding.collectMissingTypes
Status: VERIFIED DUPLICATE of bug 247666
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-06 07:26 EDT by Alex FAU CLA
Modified: 2009-09-15 06:49 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex FAU CLA 2009-08-06 07:26:35 EDT
Hi,

When I try to use ASTParser.createAST I have an exception :
java.lang.ArrayIndexOutOfBoundsException: 1
	at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.collectMissingTypes(MethodBinding.java:314)
	at org.eclipse.jdt.internal.compiler.ClassFile.generateMethodInfoAttribute(ClassFile.java:6299)
	at org.eclipse.jdt.internal.compiler.ClassFile.addProblemMethod(ClassFile.java:949)
	at org.eclipse.jdt.internal.compiler.ClassFile.createProblemType(ClassFile.java:195)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:500)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:581)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:345)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:871)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:518)
	at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:880)
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:656)

Looking at the code that throw the exception :
for (int i = 0, max = this.typeVariables.length; i < max; i++) {
			TypeVariableBinding variable = this.typeVariables[i];
			missingTypes = variable.superclass().collectMissingTypes(missingTypes);
			ReferenceBinding[] interfaces = variable.superInterfaces();
			for (int j = 0, length = interfaces.length; j < length; j++) {
				missingTypes = interfaces[i].collectMissingTypes(missingTypes);
			}
		}

Looks like the interfaces[i] must be interfaces[j] ...

@lex
Comment 1 Srikanth Sankaran CLA 2009-08-06 07:58:32 EDT
Seems to have been fixed in 3.5M3, version 1.104
of MethodBinding.java
Comment 2 Alex FAU CLA 2009-08-06 11:08:59 EDT
Hi,

FYI It is also fixed in 3.4.2.

@
Comment 3 Stephan Herrmann CLA 2009-08-07 17:31:29 EDT
So, it's a dupe of bug 247666
(fix is in MethodBinding.java version 1.105, to be precise ;-)
Comment 4 Olivier Thomann CLA 2009-08-08 19:14:08 EDT

*** This bug has been marked as a duplicate of bug 247666 ***
Comment 5 Ayushman Jain CLA 2009-09-15 02:58:07 EDT
Verified for 3.6M2 using build I20090914-1800