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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (-1 / +5 lines)
Lines 3188-3193 Link Here
3188
		return problemMethod;
3188
		return problemMethod;
3189
	}
3189
	}
3190
3190
3191
	// caveat: this is not a direct implementation of JLS
3191
	protected final MethodBinding mostSpecificMethodBinding(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType) {
3192
	protected final MethodBinding mostSpecificMethodBinding(MethodBinding[] visible, int visibleSize, TypeBinding[] argumentTypes, InvocationSite invocationSite, ReferenceBinding receiverType) {
3192
		int[] compatibilityLevels = new int[visibleSize];
3193
		int[] compatibilityLevels = new int[visibleSize];
3193
		for (int i = 0; i < visibleSize; i++)
3194
		for (int i = 0; i < visibleSize; i++)
Lines 3324-3331 Link Here
3324
							original2 = original.computeSubstitutedMethod(original2, environment());
3325
							original2 = original.computeSubstitutedMethod(original2, environment());
3325
						if (original2 == null || !original.areParameterErasuresEqual(original2))
3326
						if (original2 == null || !original.areParameterErasuresEqual(original2))
3326
							continue nextSpecific; // current does not override next
3327
							continue nextSpecific; // current does not override next
3327
						if (!original.returnType.isCompatibleWith(original2.returnType)) // 15.12.2
3328
						if (!original.returnType.isCompatibleWith(original2.returnType) &&
3329
								!original.returnType.erasure().isCompatibleWith(original2.returnType.erasure())) {
3330
							// 15.12.2
3328
							continue nextSpecific; // choose original2 instead
3331
							continue nextSpecific; // choose original2 instead
3332
						}
3329
						if (original.thrownExceptions != original2.thrownExceptions) {
3333
						if (original.thrownExceptions != original2.thrownExceptions) {
3330
							if (mostSpecificExceptions == null)
3334
							if (mostSpecificExceptions == null)
3331
								mostSpecificExceptions = original.thrownExceptions;
3335
								mostSpecificExceptions = original.thrownExceptions;
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java (-1 / +1 lines)
Lines 1076-1082 Link Here
1076
	"2");
1076
	"2");
1077
}	
1077
}	
1078
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162026
1078
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162026
1079
public void _test025() {
1079
public void test025() {
1080
	this.runConformTest(
1080
	this.runConformTest(
1081
		new String[] {
1081
		new String[] {
1082
			"X.java",
1082
			"X.java",

Return to bug 162026