Community
Participate
Working Groups
Attched is the error log file with the stack trace, and the source file. I suspect (gut feel) that the problem might be due to a base file using a subclass file as a delegate.
Created attachment 38651 [details] error log
Created attachment 38652 [details] source file that generates the error
Small test case that reproduces the same stack trace. public interface X<T> { interface I1<T> extends X<T> { interface I2<T> extends I1<T> { } interface I3<T> extends I1<T> { } interface I4<T> extends I1.I2<T>, I1.I3<T> { } } } If interface I1 doesn't extends X, it compiles fine. javac 1.5.0_06 compiles the test case without a problem. If all interfaces are not nested, then it works fine. Using HEAD, I get three errors: ---------- 1. ERROR in D:\tests_sources\X.java (at line 0) public interface X<T> { ^ Internal compiler error java.lang.ArrayIndexOutOfBoundsException: -1 at org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference.checkBounds(ParameterizedQualifiedTypeReference.java:55) at org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference.checkBounds(ParameterizedQualifiedTypeReference.java:47) at org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference.checkBounds(ParameterizedQualifiedTypeReference.java:47) at org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference.checkBounds(ParameterizedQualifiedTypeReference.java:40) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.checkParameterizedTypeBounds(ClassScope.java:765) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.checkParameterizedTypeBounds(ClassScope.java:775) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.checkParameterizedTypeBounds(ClassScope.java:775) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkParameterizedTypes(CompilationUnitScope.java:204) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:204) at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:371) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:385) at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:2825) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1303) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1109) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1101) at org.eclipse.jdt.core.tools.compiler.Compile.main(Compile.java:19) ---------- 2. ERROR in D:\tests_sources\X.java (at line 9) interface I4<T> extends I1.I2<T>, I1.I3<T> { ^^^^^ The member type X<T>.I1.I2 cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<T>.I1 ---------- 3. ERROR in D:\tests_sources\X.java (at line 9) interface I4<T> extends I1.I2<T>, I1.I3<T> { ^^^^^ The member type X<T>.I1.I3 cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<T>.I1 ----------
2 issues: 1. no exception should occur 2. no error should be reported when resolving I1.I2<T> (shouln't complain about parameterized enclosing type X<T>). Added GenericTypeTest#test0970
Problem (1) comes from invalid recursion on enclosing type, where it should only check bounds of as long as there are some specified arguments (ParameterizedQualifiedTypeReference#checkBounds). Problem (2) comes from incorrect conversion to raw of I1 in ParameterizedQualifiedTypeReference#internalResolveType. See attached patch. Fixed
Created attachment 38780 [details] Proposed fix
Created attachment 38781 [details] Better fix
Verified with I20060427-1600 for RC2.