### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java,v retrieving revision 1.91 diff -u -r1.91 ParameterizedTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 16 Mar 2007 18:28:58 -0000 1.91 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java 10 Apr 2007 19:00:05 -0000 @@ -19,7 +19,7 @@ */ public class ParameterizedTypeBinding extends ReferenceBinding implements Substitution { - public ReferenceBinding type; + private ReferenceBinding type; // must ensure the type is resolved public TypeBinding[] arguments; public LookupEnvironment environment; public char[] genericTypeSignature; @@ -41,11 +41,11 @@ // } initialize(type, arguments); if (type instanceof UnresolvedReferenceBinding) - ((UnresolvedReferenceBinding) type).addWrapper(this); + ((UnresolvedReferenceBinding) type).addWrapper(this, environment); if (arguments != null) { for (int i = 0, l = arguments.length; i < l; i++) if (arguments[i] instanceof UnresolvedReferenceBinding) - ((UnresolvedReferenceBinding) arguments[i]).addWrapper(this); + ((UnresolvedReferenceBinding) arguments[i]).addWrapper(this, environment); } this.tagBits |= TagBits.HasUnresolvedTypeVariables; // cleared in resolve() } @@ -778,7 +778,14 @@ } return this.methods; } - + + /** + * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#qualifiedPackageName() + */ + public char[] qualifiedPackageName() { + return this.type.qualifiedPackageName(); + } + /** * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#qualifiedSourceName() */ @@ -840,6 +847,12 @@ return this; } + public ReferenceBinding genericType() { + if (this.type instanceof UnresolvedReferenceBinding) + ((UnresolvedReferenceBinding) this.type).resolve(this.environment, false); + return this.type; + } + /** * @see org.eclipse.jdt.internal.compiler.lookup.Binding#shortReadableName() */ @@ -970,13 +983,6 @@ } /** - * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#qualifiedPackageName() - */ - public char[] qualifiedPackageName() { - return this.type.qualifiedPackageName(); - } - - /** * @see java.lang.Object#toString() */ public String toString() { @@ -1051,6 +1057,12 @@ } + protected ReferenceBinding type() { + // can be an UnresolvedReferenceBinding + // most clients should call resolveType() + return this.type; + } + public TypeVariableBinding[] typeVariables() { if (this.arguments == null) { // retain original type variables if not substituted (member type of parameterized type) Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v retrieving revision 1.145 diff -u -r1.145 ClassScope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 6 Mar 2007 02:38:51 -0000 1.145 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 10 Apr 2007 19:00:05 -0000 @@ -1002,7 +1002,7 @@ // abstract class X implements java.util.Map // static abstract class M implements Entry if (superType.isParameterizedType()) - superType = ((ParameterizedTypeBinding) superType).type; + superType = ((ParameterizedTypeBinding) superType).genericType(); compilationUnitScope().recordSuperTypeReference(superType); // to record supertypes return detectHierarchyCycle(referenceContext.binding, (ReferenceBinding) superType, reference); } @@ -1016,7 +1016,7 @@ // Answer whether a cycle was found between the sourceType & the superType private boolean detectHierarchyCycle(SourceTypeBinding sourceType, ReferenceBinding superType, TypeReference reference) { if (superType.isRawType()) - superType = ((RawTypeBinding) superType).type; + superType = ((RawTypeBinding) superType).genericType(); // by this point the superType must be a binary or source type if (sourceType == superType) { @@ -1052,7 +1052,7 @@ return true; } if (parentType.isParameterizedType()) - parentType = ((ParameterizedTypeBinding) parentType).type; + parentType = ((ParameterizedTypeBinding) parentType).genericType(); hasCycle |= detectHierarchyCycle(sourceType, parentType, reference); if ((parentType.tagBits & TagBits.HierarchyHasProblems) != 0) { sourceType.tagBits |= TagBits.HierarchyHasProblems; @@ -1071,7 +1071,7 @@ return true; } if (anInterface.isParameterizedType()) - anInterface = ((ParameterizedTypeBinding) anInterface).type; + anInterface = ((ParameterizedTypeBinding) anInterface).genericType(); hasCycle |= detectHierarchyCycle(sourceType, anInterface, reference); if ((anInterface.tagBits & TagBits.HierarchyHasProblems) != 0) { sourceType.tagBits |= TagBits.HierarchyHasProblems; Index: compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java,v retrieving revision 1.28 diff -u -r1.28 RawTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java 14 Apr 2006 08:34:05 -0000 1.28 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/RawTypeBinding.java 10 Apr 2007 19:00:05 -0000 @@ -37,7 +37,7 @@ for (int i = 0; i < typeSig.length-1; i++) sig.append(typeSig[i]); // copy all but trailing semicolon sig.append('.').append(sourceName()).append('<').append('>').append(';'); } else { - sig.append(this.type.computeUniqueKey(false/*not a leaf*/)); + sig.append(genericType().computeUniqueKey(false/*not a leaf*/)); sig.insert(sig.length()-1, "<>"); //$NON-NLS-1$ } @@ -66,7 +66,7 @@ */ public String debugName() { StringBuffer nameBuffer = new StringBuffer(10); - nameBuffer.append(this.type.sourceName()).append("#RAW"); //$NON-NLS-1$ + nameBuffer.append(type().sourceName()).append("#RAW"); //$NON-NLS-1$ return nameBuffer.toString(); } @@ -86,7 +86,7 @@ this.genericTypeSignature = new char[sigLength]; sig.getChars(0, sigLength, this.genericTypeSignature, 0); } else { - this.genericTypeSignature = this.type.signature(); // erasure + this.genericTypeSignature = genericType().signature(); // erasure } } return this.genericTypeSignature; @@ -137,7 +137,7 @@ } protected void initializeArguments() { - TypeVariableBinding[] typeVariables = this.type.typeVariables(); + TypeVariableBinding[] typeVariables = genericType().typeVariables(); int length = typeVariables.length; TypeBinding[] typeArguments = new TypeBinding[length]; for (int i = 0; i < length; i++) { @@ -154,7 +154,7 @@ if (isMemberType()) { readableName = CharOperation.concat(enclosingType().readableName(), sourceName, '.'); } else { - readableName = CharOperation.concatWith(this.type.compoundName, '.'); + readableName = CharOperation.concatWith(type().compoundName, '.'); } return readableName; } @@ -167,7 +167,7 @@ if (isMemberType()) { shortReadableName = CharOperation.concat(enclosingType().shortReadableName(), sourceName, '.'); } else { - shortReadableName = this.type.sourceName; + shortReadableName = type().sourceName; } return shortReadableName; } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java,v retrieving revision 1.27 diff -u -r1.27 UnresolvedReferenceBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java 22 Dec 2006 16:02:08 -0000 1.27 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/UnresolvedReferenceBinding.java 10 Apr 2007 19:00:06 -0000 @@ -23,7 +23,13 @@ this.fPackage = packageBinding; this.wrappers = null; } -void addWrapper(TypeBinding wrapper) { +void addWrapper(TypeBinding wrapper, LookupEnvironment environment) { + if (this.resolvedType != null) { + // the type reference B.M> means a signature of LB.M;>; + // when the ParameterizedType for Unresolved B is created with args B.M, the Unresolved B is resolved before the wrapper is added + wrapper.swapUnresolved(this, this.resolvedType, environment); + return; + } if (this.wrappers == null) { this.wrappers = new TypeBinding[] {wrapper}; } else { Index: compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java,v retrieving revision 1.103 diff -u -r1.103 BinaryTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 8 Jan 2007 15:48:21 -0000 1.103 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java 10 Apr 2007 19:00:05 -0000 @@ -162,6 +162,9 @@ this.sourceName = binaryType.getSourceName(); this.modifiers = binaryType.getModifiers(); + + if ((binaryType.getTagBits() & TagBits.HasInconsistentHierarchy) != 0) + this.tagBits |= TagBits.HierarchyHasProblems; if (binaryType.isAnonymous()) { this.tagBits |= TagBits.AnonymousTypeMask; Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java,v retrieving revision 1.71 diff -u -r1.71 MethodVerifier15.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 28 Mar 2007 04:52:19 -0000 1.71 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java 10 Apr 2007 19:00:05 -0000 @@ -675,9 +675,8 @@ } ParameterizedTypeBinding substituteReturnType = (ParameterizedTypeBinding) substituteMethod.returnType, existingReturnType = (ParameterizedTypeBinding) existingMethod.returnType; - if (substituteReturnType.type != existingReturnType.type) { + if (substituteReturnType.type() != existingReturnType.type()) return false; - } for (int i = 0; i < substituteReturnType.arguments.length; i++) { TypeBinding substituteArgumentType, existingArgumentType; if (! (existingArgumentType = existingReturnType.arguments[i]).isCompatibleWith( Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java,v retrieving revision 1.145 diff -u -r1.145 SourceTypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 31 Mar 2007 18:41:36 -0000 1.145 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java 10 Apr 2007 19:00:05 -0000 @@ -1005,7 +1005,7 @@ if ((otherType.tagBits & TagBits.HasDirectWildcard) == 0 && (!this.isMemberType() || !otherType.isMemberType())) return false; // should have been identical ParameterizedTypeBinding otherParamType = (ParameterizedTypeBinding) otherType; - if (this != otherParamType.type) + if (this != otherParamType.type()) return false; if (!isStatic()) { // static member types do not compare their enclosing ReferenceBinding enclosing = enclosingType(); Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.303 diff -u -r1.303 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 7 Mar 2007 17:06:33 -0000 1.303 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 10 Apr 2007 19:00:05 -0000 @@ -241,7 +241,7 @@ TypeBinding[] substitutedArguments = originalArguments; if (originalArguments != null) { if (substitution.isRawSubstitution()) { - return originalParameterizedType.environment.createRawType(originalParameterizedType.type, substitutedEnclosing); + return originalParameterizedType.environment.createRawType(originalParameterizedType.genericType(), substitutedEnclosing); } substitutedArguments = substitute(substitution, originalArguments); } @@ -259,7 +259,7 @@ // return originalParameterizedType.type; // } return originalParameterizedType.environment.createParameterizedType( - originalParameterizedType.type, substitutedArguments, substitutedEnclosing); + originalParameterizedType.genericType(), substitutedArguments, substitutedEnclosing); } break; @@ -951,7 +951,7 @@ ReferenceBinding[] itsInterfaces = currentType.superInterfaces(); if (itsInterfaces == null) { // needed for statically imported types which don't know their hierarchy yet ReferenceBinding sourceType = currentType.isParameterizedType() - ? ((ParameterizedTypeBinding) enclosingType).type + ? ((ParameterizedTypeBinding) enclosingType).genericType() : currentType; if (sourceType.isHierarchyBeingConnected()) return null; // looking for an undefined member type in its own superclass ref Index: compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java,v retrieving revision 1.76 diff -u -r1.76 LookupEnvironment.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 3 Apr 2007 13:53:46 -0000 1.76 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java 10 Apr 2007 19:00:05 -0000 @@ -442,7 +442,7 @@ break; case Binding.PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = (ParameterizedTypeBinding) originalType; - needToConvert = paramType.type.isGenericType(); // only recursive call to enclosing type can find parameterizedType with arguments + needToConvert = paramType.genericType().isGenericType(); // only recursive call to enclosing type can find parameterizedType with arguments break; default : needToConvert = false; @@ -505,7 +505,7 @@ break; case Binding.PARAMETERIZED_TYPE : ParameterizedTypeBinding paramType = (ParameterizedTypeBinding) originalType; - needToConvert = paramType.type.isGenericType(); // only recursive call to enclosing type can find parameterizedType with arguments + needToConvert = paramType.genericType().isGenericType(); // only recursive call to enclosing type can find parameterizedType with arguments break; default : needToConvert = false; @@ -722,7 +722,7 @@ for (int max = cachedInfo.length; index < max; index++){ ParameterizedTypeBinding cachedType = cachedInfo[index]; if (cachedType == null) break nextCachedType; - if (cachedType.type != genericType) continue nextCachedType; // remain of unresolved type + if (cachedType.type() != genericType) continue nextCachedType; // remain of unresolved type if (cachedType.enclosingType() != enclosingType) continue nextCachedType; TypeBinding[] cachedArguments = cachedType.arguments; int cachedArgLength = cachedArguments == null ? 0 : cachedArguments.length; @@ -761,7 +761,7 @@ for (int max = cachedInfo.length; index < max; index++){ RawTypeBinding cachedType = cachedInfo[index]; if (cachedType == null) break nextCachedType; - if (cachedType.type != genericType) continue nextCachedType; // remain of unresolved type + if (cachedType.type() != genericType) continue nextCachedType; // remain of unresolved type if (cachedType.enclosingType() != enclosingType) continue nextCachedType; // all enclosing type match, reuse current return cachedType; @@ -1108,7 +1108,7 @@ wrapper.start++; // skip '.' char[] memberName = wrapper.nextWord(); BinaryTypeBinding.resolveType(parameterizedType, this, false); - ReferenceBinding memberType = parameterizedType.type.getMemberType(memberName); + ReferenceBinding memberType = parameterizedType.genericType().getMemberType(memberName); if (wrapper.signature[wrapper.start] == '<') { wrapper.start++; // skip '<' typeArguments = getTypeArgumentsFromSignature(wrapper, staticVariables, enclosingType, memberType); Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java,v retrieving revision 1.54 diff -u -r1.54 ArrayBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java 16 Mar 2007 18:28:58 -0000 1.54 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/ArrayBinding.java 10 Apr 2007 19:00:04 -0000 @@ -31,7 +31,7 @@ this.dimensions = dimensions; this.environment = environment; if (type instanceof UnresolvedReferenceBinding) - ((UnresolvedReferenceBinding) type).addWrapper(this); + ((UnresolvedReferenceBinding) type).addWrapper(this, environment); else this.tagBits |= type.tagBits & (TagBits.HasTypeVariable | TagBits.HasDirectWildcard); } Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java,v retrieving revision 1.82 diff -u -r1.82 TypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 16 Mar 2007 18:28:58 -0000 1.82 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 10 Apr 2007 19:00:06 -0000 @@ -495,7 +495,7 @@ case Binding.PARAMETERIZED_TYPE: ParameterizedTypeBinding parameterizedType = (ParameterizedTypeBinding) this; - if (parameterizedType.type.isProvablyDistinctFrom(otherType.erasure(), depth)) + if (parameterizedType.genericType().isProvablyDistinctFrom(otherType.erasure(), depth)) return true; switch (otherType.kind()) { case Binding.GENERIC_TYPE: @@ -649,7 +649,7 @@ return false; ParameterizedTypeBinding paramType = (ParameterizedTypeBinding) this; ParameterizedTypeBinding otherParamType = (ParameterizedTypeBinding) otherType; - if (paramType.type != otherParamType.type) + if (paramType.type() != otherParamType.type()) return false; if (!paramType.isStatic()) { // static member types do not compare their enclosing ReferenceBinding enclosing = enclosingType(); Index: compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java,v retrieving revision 1.62 diff -u -r1.62 WildcardBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 29 Mar 2007 12:06:04 -0000 1.62 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java 10 Apr 2007 19:00:06 -0000 @@ -44,9 +44,9 @@ initialize(genericType, bound, otherBounds); if (genericType instanceof UnresolvedReferenceBinding) - ((UnresolvedReferenceBinding) genericType).addWrapper(this); + ((UnresolvedReferenceBinding) genericType).addWrapper(this, environment); if (bound instanceof UnresolvedReferenceBinding) - ((UnresolvedReferenceBinding) bound).addWrapper(this); + ((UnresolvedReferenceBinding) bound).addWrapper(this, environment); this.tagBits |= TagBits.HasUnresolvedTypeVariables; // cleared in resolve() } Index: search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java,v retrieving revision 1.73 diff -u -r1.73 MethodLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 6 Mar 2007 02:38:49 -0000 1.73 +++ search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 10 Apr 2007 19:00:06 -0000 @@ -527,7 +527,7 @@ locator.reportBinaryMemberDeclaration(resource, method, methodBinding, info, SearchMatch.A_ACCURATE); } else { if (declaringClass instanceof ParameterizedTypeBinding) - declaringClass = ((ParameterizedTypeBinding) declaringClass).type; + declaringClass = ((ParameterizedTypeBinding) declaringClass).genericType(); ClassScope scope = ((SourceTypeBinding) declaringClass).scope; if (scope != null) { TypeDeclaration typeDecl = scope.referenceContext; Index: search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java,v retrieving revision 1.53 diff -u -r1.53 TypeReferenceLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 20 Oct 2006 11:02:03 -0000 1.53 +++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 10 Apr 2007 19:00:06 -0000 @@ -600,7 +600,7 @@ locator.reportBinaryMemberDeclaration(resource, type, typeBinding, info, SearchMatch.A_ACCURATE); } else { if (typeBinding instanceof ParameterizedTypeBinding) - typeBinding = ((ParameterizedTypeBinding) typeBinding).type; + typeBinding = ((ParameterizedTypeBinding) typeBinding).genericType(); ClassScope scope = ((SourceTypeBinding) typeBinding).scope; if (scope != null) { TypeDeclaration typeDecl = scope.referenceContext; Index: search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java,v retrieving revision 1.63 diff -u -r1.63 PatternLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 10 Nov 2006 17:54:00 -0000 1.63 +++ search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 10 Apr 2007 19:00:06 -0000 @@ -442,7 +442,7 @@ // Set match raw flag boolean endPattern = patternTypeArguments==null ? true : depth>=patternTypeArguments.length; TypeBinding[] argumentsBindings = parameterizedBinding.arguments; - boolean isRaw = parameterizedBinding.isRawType()|| (argumentsBindings==null && parameterizedBinding.type.isGenericType()); + boolean isRaw = parameterizedBinding.isRawType()|| (argumentsBindings==null && parameterizedBinding.genericType().isGenericType()); if (isRaw && !match.isRaw()) { match.setRaw(isRaw); } @@ -452,7 +452,7 @@ // verify if this is a reference to the generic type itself if (!isRaw && patternHasTypeParameters && argumentsBindings != null) { boolean needUpdate = false; - TypeVariableBinding[] typeVariables = parameterizedBinding.type.typeVariables(); + TypeVariableBinding[] typeVariables = parameterizedBinding.genericType().typeVariables(); for (int i=0, l=argumentsBindings.length; i 15 || c1 < 0 || (c2 = ScannerHelper.getNumericValue(source[pos++])) > 15 @@ -560,7 +560,7 @@ */ private boolean isLocal(ReferenceBinding binding) { if(binding instanceof ParameterizedTypeBinding) { - return isLocal(((ParameterizedTypeBinding)binding).type); + return isLocal(((ParameterizedTypeBinding)binding).genericType()); } if (!(binding instanceof SourceTypeBinding)) return false; if (binding instanceof LocalTypeBinding) return true; Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v retrieving revision 1.322 diff -u -r1.322 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 12 Mar 2007 09:42:26 -0000 1.322 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 10 Apr 2007 19:00:03 -0000 @@ -5768,7 +5768,7 @@ completion.append('.'); completion.append(parameterizedType.sourceName); } else { - completion.append(CharOperation.concatWith(parameterizedType.type.compoundName, '.')); + completion.append(CharOperation.concatWith(parameterizedType.genericType().compoundName, '.')); } if (parameterizedType.arguments != null) { completion.append('<'); @@ -6082,7 +6082,7 @@ hasPotentialDefaultAbstractMethods = false; } if(currentType.isParameterizedType()) { - currentType = ((ParameterizedTypeBinding)currentType).type.superclass(); + currentType = ((ParameterizedTypeBinding)currentType).genericType().superclass(); } else { currentType = currentType.superclass(); } Index: model/org/eclipse/jdt/internal/core/SelectionRequestor.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java,v retrieving revision 1.70 diff -u -r1.70 SelectionRequestor.java --- model/org/eclipse/jdt/internal/core/SelectionRequestor.java 6 Mar 2007 02:38:49 -0000 1.70 +++ model/org/eclipse/jdt/internal/core/SelectionRequestor.java 10 Apr 2007 19:00:06 -0000 @@ -281,7 +281,7 @@ public void acceptLocalField(FieldBinding fieldBinding) { IJavaElement res; if(fieldBinding.declaringClass instanceof ParameterizedTypeBinding) { - LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)fieldBinding.declaringClass).type; + LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)fieldBinding.declaringClass).genericType(); res = findLocalElement(localTypeBinding.sourceStart()); } else { SourceTypeBinding typeBinding = (SourceTypeBinding)fieldBinding.declaringClass; @@ -361,7 +361,7 @@ public void acceptLocalType(TypeBinding typeBinding) { IJavaElement res = null; if(typeBinding instanceof ParameterizedTypeBinding) { - LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)typeBinding).type; + LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)typeBinding).genericType(); res = findLocalElement(localTypeBinding.sourceStart()); } else if(typeBinding instanceof SourceTypeBinding) { res = findLocalElement(((SourceTypeBinding)typeBinding).sourceStart()); @@ -379,7 +379,7 @@ public void acceptLocalTypeParameter(TypeVariableBinding typeVariableBinding) { IJavaElement res; if(typeVariableBinding.declaringElement instanceof ParameterizedTypeBinding) { - LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)typeVariableBinding.declaringElement).type; + LocalTypeBinding localTypeBinding = (LocalTypeBinding)((ParameterizedTypeBinding)typeVariableBinding.declaringElement).genericType(); res = findLocalElement(localTypeBinding.sourceStart()); } else { SourceTypeBinding typeBinding = (SourceTypeBinding)typeVariableBinding.declaringElement; #P org.eclipse.jdt.core.tests.builder Index: src/org/eclipse/jdt/core/tests/builder/Java50Tests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java,v retrieving revision 1.8 diff -u -r1.8 Java50Tests.java --- src/org/eclipse/jdt/core/tests/builder/Java50Tests.java 6 Mar 2007 04:43:25 -0000 1.8 +++ src/org/eclipse/jdt/core/tests/builder/Java50Tests.java 10 Apr 2007 19:00:08 -0000 @@ -59,7 +59,81 @@ "Problem : The annotation @Ann is disallowed for this location [ resource : range : <11,17> category : <40> severity : <2>]" ); } - + + public void testParameterizedMemberType() throws JavaModelException { + IPath projectPath = env.addProject("Project", "1.5"); + env.addExternalJars(projectPath, Util.getJavaClassLibs()); + env.setOutputFolder(projectPath, ""); + + IPath xPath = env.addClass(projectPath, "", "X", + "class X extends A {}" + ); + + IPath aPath = env.addClass(projectPath, "", "A", + "class A extends B.M> {}\n" + + "class B extends Missing {\n" + + " class M{}\n" + + "}\n" + + "class Missing {}" + ); + + fullBuild(projectPath); + expectingNoProblems(); + + env.addClass(projectPath, "", "A", + "class A extends B.M> {}\n" + + "class B extends Missing {\n" + + " class M{}\n" + + "}" + ); + + incrementalBuild(projectPath); + expectingProblemsFor( + new IPath[] {aPath, xPath}, + "Problem : The hierarchy of the type A is inconsistent [ resource : range : <6,7> category : <40> severity : <2>]\n" + + "Problem : Missing cannot be resolved to a type [ resource : range : <51,58> category : <40> severity : <2>]\n" + + "Problem : The hierarchy of the type X is inconsistent [ resource : range : <6,7> category : <40> severity : <2>]" + ); + + env.addClass(projectPath, "", "X", + "class X extends A {}" + ); + + incrementalBuild(projectPath); + expectingProblemsFor( + new IPath[] {aPath, xPath}, + "Problem : The hierarchy of the type A is inconsistent [ resource : range : <6,7> category : <40> severity : <2>]\n" + + "Problem : Missing cannot be resolved to a type [ resource : range : <51,58> category : <40> severity : <2>]\n" + + "Problem : The hierarchy of the type X is inconsistent [ resource : range : <6,7> category : <40> severity : <2>]" + ); + + env.addClass(projectPath, "", "A", + "class A extends B.M> {}\n" + + "class B extends Missing {\n" + + " class M{}\n" + + "}" + ); + + incrementalBuild(projectPath); + expectingProblemsFor( + new IPath[] {aPath, xPath}, + "Problem : The hierarchy of the type A is inconsistent [ resource : range : <6,7> category : <40> severity : <2>]\n" + + "Problem : Missing cannot be resolved to a type [ resource : range : <51,58> category : <40> severity : <2>]\n" + + "Problem : The hierarchy of the type X is inconsistent [ resource : range : <6,7> category : <40> severity : <2>]" + ); + + env.addClass(projectPath, "", "A", + "class A extends B.M> {}\n" + + "class B extends Missing {\n" + + " class M{}\n" + + "}\n" + + "class Missing {}" + ); + + incrementalBuild(projectPath); + expectingNoProblems(); + } + public void testParameterizedType1() throws JavaModelException { IPath projectPath = env.addProject("Project", "1.5"); env.addExternalJars(projectPath, Util.getJavaClassLibs());