Community
Participate
Working Groups
its not possible to extend generic interfaces: public interface A<T> { } public interface B<T> extends A<T> { } fails with Internal compiler error java.lang.ArrayIndexOutOfBoundsException: 22 at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:651) at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:192) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:314) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:297) at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:191) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:107) at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:173) at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:1602) at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:1395) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.internalResolveType(ParameterizedSingleTypeReference.java:62) at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.resolveType(ParameterizedSingleTypeReference.java:153) at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:93) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:882) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperInterfaces(ClassScope.java:665) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:719) at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:236) at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:177) at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:305) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:319) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:209) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:159) at org.eclipse.jdt.internal.core.builder.IncrementalImageBuilder.build(IncrementalImageBuilder.java:113) at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildDeltas(JavaBuilder.java:223) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:151) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:512) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:611) at org.eclipse.core.runtime.Platform.run(Platform.java:543) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:140) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:227) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:169) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:197) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:611) at org.eclipse.core.runtime.Platform.run(Platform.java:543) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:200) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:245) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:273) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:141) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:177) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:62)
If i change A to import java.util.Collection; public interface A<T> extends Collection<T> { } I do not get an exception.
It works fine now. You were likely using Cheetah01, weren't you ?
No im using latest drop cheetah02. id = "org.eclipse.jdt.core" version = "3.0.0.cheetah02" but it is actually only every second time I save a file I get the exception. Using the above example: save B -> no problem save B again -> ArrayIndexOfBound save B again-> no problem save B again -> ArrayIndexOfBound ............(no modfications just adding a space) another problem with B is that the compiler complains about "The type A is not generic; it cannot be parameterized with arguments T" (while underlining A in B, interface B<T> extends _A_<T> { ... this happens no matter if I extend Collection from A or not.
Tried cheetah_03 and its *still* an issue. Notice that i've only experienced problems with interfaces. Here are some usecase that work ------ public class A<T> { } public class B<T> extends A<T>{} ----- //for some there arent any problem if they are declared in the same file public class F { public static class B<T>{} public interface C<T>{} public static class D<T> extends B<T>{} public static class E<T> implements C<T>{} } ----------- Here are two that only compiles occasionally ----- public interface C<T> {} public class E<T> implements C<T> {} ----- public interface C<T> {} public interface D<T> extends C<T> {} ------
One more update:) public interface A {} public interface B extends A {} works, but public interface A<T> {} public interface B extends A {} doesn't
These problems only show up when reconciling editor changes. These never occur when building. Problem comes from the fact that the source element converter doesn't recreate type variables (yet).
BTW, with Cheetah03, I did not get any exception. Simply unexpected compile errors about a type not being generic.
*** Bug 62806 has been marked as a duplicate of this bug. ***
Added basic support to JavaModel to surface type parameters in type declarations; so as to get reconcile operations happy again. This isn't the final take on this front, need to switch to using signatures instead of type names in SourceTypeConverter, plus generalize the solution to other ISourceElementRequestor implementations; also need to support constructor/method type parameters.
Will still close this one defect as the released basic support covers these very issues.