Community
Participate
Working Groups
Using build I200409212000. With following test case: X.java package p; public class X<T> { class Member {} } Y.java package p; public class Y { p.X.Member m; } The binding reference "p.X.Member" is a MemberTypeBinding instead of expected ParameterizedTypeBinding... Also member type binding enclosing type is a SourceTypeBinding instead of expected RawTypeBinding...
Similar to bug 74544. Here problem comes from QualifiedTypeReference.getTypeBinding(Scope). Replace code: qualifiedType = this.resolvedType.isGenericType() ? scope.environment().createRawType((ReferenceBinding)this.resolvedType, qualifiedType) : (ReferenceBinding) this.resolvedType; with: ReferenceBinding currentType = (ReferenceBinding) this.resolvedType; if (this.resolvedType.isGenericType()) { qualifiedType = scope.environment().createRawType(currentType, qualifiedType); } else { qualifiedType = (qualifiedType != null && qualifiedType.isRawType()) ? scope.createParameterizedType(currentType, null, qualifiedType) : currentType; } fixes the problem
Sounds like the right fix. Pls add a regression test as well in GenericTypeTest. Post M2.
Previous fix does not resolve all problems... Following test case still fails with it: X.java package p; public class X<T> { class Member { class Sub {} } } Y.java package p; public class Y { p.X.Member.Sub s; p.X<Exception>.Member.Sub es = s; } We need also to test whether qualified type is a parameterized type or not: qualifiedType = (qualifiedType != null && (qualifiedType.isRawType() || qualifiedType.isParameterizedType()))
Fixed. [jdt-core-internal] Test cases 308 and 309 added to GenericTypeTests
Verified for 3.1M3 with build I20041101