View | Details | Raw Unified | Return to bug 165620 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java (-2 / +2 lines)
Lines 1557-1563 Link Here
1557
}
1557
}
1558
1558
1559
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163370
1559
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=163370
1560
public void _test044() {
1560
public void test044() {
1561
	this.runConformTest(
1561
	this.runConformTest(
1562
		new String[] {
1562
		new String[] {
1563
			"X.java",
1563
			"X.java",
Lines 1580-1586 Link Here
1580
}
1580
}
1581
1581
1582
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165620
1582
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=165620
1583
public void _test045() {
1583
public void test045() {
1584
	this.runConformTest(
1584
	this.runConformTest(
1585
		new String[] {
1585
		new String[] {
1586
			"X.java",
1586
			"X.java",
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java (+25 lines)
Lines 1058-1061 Link Here
1058
		} 
1058
		} 
1059
		return Binding.NO_TYPE_VARIABLES;
1059
		return Binding.NO_TYPE_VARIABLES;
1060
	}	
1060
	}	
1061
1062
boolean uses(TypeBinding variable) {
1063
	int argsNb = this.arguments.length;
1064
	for (int i = 0; i < argsNb; i++) {
1065
		if (this.arguments[i] == variable || this.arguments[i].uses(variable)) {
1066
			return true;
1067
		}
1068
	}
1069
	return false;
1070
}
1071
TypeBinding clearedOf(TypeBinding variable) {
1072
	if (uses(variable)) {
1073
		int argsNb;
1074
		TypeBinding[] newArguments = new TypeBinding[argsNb = this.arguments.length];
1075
		for (int i = 0; i < argsNb; i++) {
1076
			if (this.arguments[i].uses(variable)) {
1077
				return new RawTypeBinding(this.type, this.enclosingType, this.environment);
1078
			}
1079
			newArguments[i] = this.arguments[i].clearedOf(variable);
1080
		}
1081
		return new ParameterizedTypeBinding(this.type, newArguments, 
1082
				this.enclosingType, this.environment);
1083
	}
1084
	return this;
1085
}
1061
}
1086
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java (+7 lines)
Lines 963-966 Link Here
963
public TypeVariableBinding[] typeVariables() {
963
public TypeVariableBinding[] typeVariables() {
964
	return Binding.NO_TYPE_VARIABLES;
964
	return Binding.NO_TYPE_VARIABLES;
965
}
965
}
966
967
boolean uses(TypeBinding variable) {
968
	return false;
969
}
970
TypeBinding clearedOf(TypeBinding variable) {
971
		return this;
972
}
966
}
973
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedGenericMethodBinding.java (-2 / +9 lines)
Lines 461-471 Link Here
461
			boolean isStatic = this.isStatic();
461
			boolean isStatic = this.isStatic();
462
			for (int i = 0; i < length; i++) {
462
			for (int i = 0; i < length; i++) {
463
				newArguments[i] = isStatic ? 
463
				newArguments[i] = isStatic ? 
464
					originalVariables[i].upperBound() : // do not rawify for statics
464
					upperBound(originalVariables[i]) : // do not rawify for statics
465
					environment.convertToRawType(originalVariables[i].upperBound());
465
					environment.convertToRawType(originalVariables[i].upperBound());
466
			}
466
			}
467
			this.tiebreakMethod = this.environment.createParameterizedGenericMethod(this.originalMethod, newArguments);
467
			this.tiebreakMethod = this.environment.createParameterizedGenericMethod(this.originalMethod, newArguments);
468
		} 
468
		} 
469
		return this.tiebreakMethod;
469
		return this.tiebreakMethod;
470
	}	
470
	}
471
	TypeBinding upperBound(TypeVariableBinding original) {
472
		TypeBinding result = original.firstBound;
473
		if (result == null ) {
474
			return original.superclass; // java/lang/Object
475
		} 
476
		return result.clearedOf(original); 
477
	}
471
}
478
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java (-1 / +4 lines)
Lines 440-444 Link Here
440
			return this.firstBound;
440
			return this.firstBound;
441
	    }
441
	    }
442
	    return this.superclass; // java/lang/Object
442
	    return this.superclass; // java/lang/Object
443
	}		
443
	}
444
boolean uses(TypeBinding variable) {
445
	return CharOperation.equals(((TypeVariableBinding)variable).sourceName, this.sourceName);
446
}
444
}
447
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java (+7 lines)
Lines 624-627 Link Here
624
		}
624
		}
625
		return this.typeVariable;
625
		return this.typeVariable;
626
	}
626
	}
627
628
boolean uses(TypeBinding variable) {
629
	if (this.bound != null) {
630
		return this.bound.uses(variable);
631
	}
632
	return false;
633
}
627
}
634
}

Return to bug 165620