View | Details | Raw Unified | Return to bug 275471
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java (+3 lines)
Lines 910-915 Link Here
910
public boolean isGenericType() {
910
public boolean isGenericType() {
911
    return this.typeVariables != Binding.NO_TYPE_VARIABLES;
911
    return this.typeVariables != Binding.NO_TYPE_VARIABLES;
912
}
912
}
913
public boolean isHierarchyConnected() {
914
	return (this.tagBits & TagBits.HasUnresolvedSuperclass) == 0 && (this.tagBits & TagBits.HasUnresolvedSuperinterfaces) == 0;
915
}
913
public int kind() {
916
public int kind() {
914
	if (this.typeVariables != Binding.NO_TYPE_VARIABLES)
917
	if (this.typeVariables != Binding.NO_TYPE_VARIABLES)
915
		return Binding.GENERIC_TYPE;
918
		return Binding.GENERIC_TYPE;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java (+4 lines)
Lines 733-738 Link Here
733
        return false;
733
        return false;
734
	}
734
	}
735
735
736
	public boolean isHierarchyConnected() {
737
		return this.superclass != null && this.superInterfaces != null;
738
	}
739
736
	/**
740
	/**
737
	 * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#isRawSubstitution()
741
	 * @see org.eclipse.jdt.internal.compiler.lookup.Substitution#isRawSubstitution()
738
	 */
742
	 */
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java (+3 lines)
Lines 1059-1064 Link Here
1059
public boolean isGenericType() {
1059
public boolean isGenericType() {
1060
    return this.typeVariables != Binding.NO_TYPE_VARIABLES;
1060
    return this.typeVariables != Binding.NO_TYPE_VARIABLES;
1061
}
1061
}
1062
public boolean isHierarchyConnected() {
1063
	return (this.tagBits & TagBits.EndHierarchyCheck) != 0;
1064
}
1062
public ReferenceBinding[] memberTypes() {
1065
public ReferenceBinding[] memberTypes() {
1063
	return this.memberTypes;
1066
	return this.memberTypes;
1064
}
1067
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java (+7 lines)
Lines 1064-1069 Link Here
1064
	return (this.tagBits & TagBits.EndHierarchyCheck) == 0 && (this.tagBits & TagBits.BeginHierarchyCheck) != 0;
1064
	return (this.tagBits & TagBits.EndHierarchyCheck) == 0 && (this.tagBits & TagBits.BeginHierarchyCheck) != 0;
1065
}
1065
}
1066
1066
1067
/**
1068
 * Returns true if the type hierarchy is connected
1069
 */
1070
public boolean isHierarchyConnected() {
1071
	return true;
1072
}
1073
1067
public boolean isInterface() {
1074
public boolean isInterface() {
1068
	// consider strict interfaces and annotation types
1075
	// consider strict interfaces and annotation types
1069
	return (this.modifiers & ClassFileConstants.AccInterface) != 0;
1076
	return (this.modifiers & ClassFileConstants.AccInterface) != 0;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java (+4 lines)
Lines 316-321 Link Here
316
		return false;
316
		return false;
317
	}
317
	}
318
318
319
	public boolean isHierarchyConnected() {
320
		return (this.modifiers & ExtraCompilerModifiers.AccUnresolved) == 0;
321
	}
322
319
	/**
323
	/**
320
	 * Returns true if the 2 variables are playing exact same role: they have
324
	 * Returns true if the 2 variables are playing exact same role: they have
321
	 * the same bounds, providing one is substituted with the other: <T1 extends
325
	 * the same bounds, providing one is substituted with the other: <T1 extends
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java (+4 lines)
Lines 456-461 Link Here
456
    	return this.otherBounds != null;
456
    	return this.otherBounds != null;
457
    }
457
    }
458
458
459
	public boolean isHierarchyConnected() {
460
		return this.superclass != null && this.superInterfaces != null;
461
	}
462
459
    /**
463
    /**
460
	 * Returns true if the type is a wildcard
464
	 * Returns true if the type is a wildcard
461
	 */
465
	 */
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-2 / +3 lines)
Lines 895-901 Link Here
895
			// in >= 1.5 mode, ensure the exactMatch did not match raw types
895
			// in >= 1.5 mode, ensure the exactMatch did not match raw types
896
			if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5)
896
			if (compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5)
897
				for (int i = argumentTypes.length; --i >= 0;)
897
				for (int i = argumentTypes.length; --i >= 0;)
898
					if (isSubtypeOfRawType(argumentTypes[i]))
898
					if (isPossibleSubtypeOfRawType(argumentTypes[i]))
899
						return null;
899
						return null;
900
			// must find both methods for this case: <S extends A> void foo() {}  and  <N extends B> N foo() { return null; }
900
			// must find both methods for this case: <S extends A> void foo() {}  and  <N extends B> N foo() { return null; }
901
			// or find an inherited method when the exact match is to a bridge method
901
			// or find an inherited method when the exact match is to a bridge method
Lines 2995-3001 Link Here
2995
		return false;
2995
		return false;
2996
	}
2996
	}
2997
2997
2998
	public boolean isSubtypeOfRawType(TypeBinding paramType) {
2998
	public boolean isPossibleSubtypeOfRawType(TypeBinding paramType) {
2999
		TypeBinding t = paramType.leafComponentType();
2999
		TypeBinding t = paramType.leafComponentType();
3000
		if (t.isBaseType()) return false;
3000
		if (t.isBaseType()) return false;
3001
3001
Lines 3004-3009 Link Here
3004
		int nextPosition = 0;
3004
		int nextPosition = 0;
3005
		do {
3005
		do {
3006
			if (currentType.isRawType()) return true;
3006
			if (currentType.isRawType()) return true;
3007
			if (!currentType.isHierarchyConnected()) return true; // do not fault in super types right now, so assume one is a raw type
3007
	
3008
	
3008
			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();
3009
			ReferenceBinding[] itsInterfaces = currentType.superInterfaces();
3009
			if (itsInterfaces != null && itsInterfaces != Binding.NO_SUPERINTERFACES) {
3010
			if (itsInterfaces != null && itsInterfaces != Binding.NO_SUPERINTERFACES) {

Return to bug 275471