Community
Participate
Working Groups
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
Seems to have been fixed in 3.5M3, version 1.104 of MethodBinding.java
Hi, FYI It is also fixed in 3.4.2. @
So, it's a dupe of bug 247666 (fix is in MethodBinding.java version 1.105, to be precise ;-)
*** This bug has been marked as a duplicate of bug 247666 ***
Verified for 3.6M2 using build I20090914-1800