Summary: | [1.5][compiler] internal compiler error -- ArrayOutOfBoundException | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jon Barrilleaux <jonb> | ||||||||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||
Severity: | blocker | ||||||||||||
Priority: | P3 | ||||||||||||
Version: | 3.1.2 | ||||||||||||
Target Milestone: | 3.2 RC2 | ||||||||||||
Hardware: | PC | ||||||||||||
OS: | Windows 2000 | ||||||||||||
Whiteboard: | |||||||||||||
Attachments: |
|
Description
Jon Barrilleaux
2006-04-16 21:18:40 EDT
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. |