Summary: | [1.5][compiler] Problems implementing inherited generic abstract methods and type erasure | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Henning Niss <hniss> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1.1 | ||
Target Milestone: | 3.1.2 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Henning Niss
2005-10-27 08:22:54 EDT
Could reproduce in HEAD. Proposed fix is to the constructor: ParameterizedMethodBinding(ParameterizedTypeBinding, MethodBinding) replace initialize variable bounds for loop with: for (int i = 0; i < length; i++) { TypeVariableBinding originalVar = originalVars[i]; TypeVariableBinding substitutedVar = substitutedVars[i]; TypeBinding substitutedSuperclass = Scope.substitute(substitution, originalVar.superclass); substitutedVar.superclass = (ReferenceBinding) (substitutedSuperclass.isArrayType() ? parameterizedDeclaringClass.environment.getType(JAVA_LANG_OBJECT) : substitutedSuperclass); substitutedVar.superInterfaces = Scope.substitute(substitution, originalVar.superInterfaces); if (substitutedVar.superclass.isInterface()) { if (substitutedVar.superInterfaces == NoSuperInterfaces) { substitutedVar.superInterfaces = new ReferenceBinding[] {substitutedVar.superclass}; } else { int size = substitutedVar.superInterfaces.length; System.arraycopy(substitutedVar.superInterfaces, 0, substitutedVar.superInterfaces = new ReferenceBinding[size + 1], 1, size); substitutedVar.superInterfaces[0] = substitutedVar.superclass; } substitutedVar.superclass = parameterizedDeclaringClass.environment.getType (JAVA_LANG_OBJECT); } if (originalVar.firstBound != null) { substitutedVar.firstBound = originalVar.firstBound == originalVar.superclass ? substitutedSuperclass // could be array type : substitutedVar.superInterfaces[0]; } } Released similar fix. Added GenericTypeTest#test870. Fixed in 3.2 and 3.1.2 streams. Verified for 3.2M4 in I20051212-2000 Verified for 3.1.2 in M20060109-0800. |