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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java (-2 / +2 lines)
Lines 5327-5333 Link Here
5327
		"----------\n");
5327
		"----------\n");
5328
}
5328
}
5329
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331
5329
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331
5330
public void _test133() {
5330
public void test133() {
5331
	if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
5331
	if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
5332
		this.runConformTest(
5332
		this.runConformTest(
5333
			new String[] {
5333
			new String[] {
Lines 5362-5368 Link Here
5362
	}
5362
	}
5363
}
5363
}
5364
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331
5364
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=168331
5365
public void _test134() {
5365
public void test134() {
5366
	if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
5366
	if (this.complianceLevel.compareTo(COMPLIANCE_1_5) >= 0) {
5367
		this.runConformTest(
5367
		this.runConformTest(
5368
			new String[] {
5368
			new String[] {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java (-1 / +1 lines)
Lines 1457-1463 Link Here
1457
		"");
1457
		"");
1458
}
1458
}
1459
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
1459
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
1460
public void _test032() {
1460
public void test032() {
1461
	this.runConformTest(
1461
	this.runConformTest(
1462
		new String[] {
1462
		new String[] {
1463
			"X.java",
1463
			"X.java",
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java (-2 / +18 lines)
Lines 301-306 Link Here
301
			}
301
			}
302
		}
302
		}
303
	}
303
	}
304
	if (count == 1) return; // no need to continue since only 1 inherited method is left
305
	// get rid of overriden methods coming from interfaces
306
	MethodBinding existingMethod, inheritedMethod;
307
	for (int i = 0; i < length; i++) {
308
		if ((existingMethod = methods[i]) != null) {
309
			for (int j = 0; j < length; j++) {
310
				if (i != j && (inheritedMethod = methods[j]) != null && 
311
						doesMethodOverride(existingMethod, inheritedMethod) &&
312
						existingMethod.declaringClass.implementsInterface(inheritedMethod.declaringClass, true)) {
313
					count--;
314
					methods[j] = null;
315
				}
316
			}
317
		}
318
	}
304
	if (count < length) {
319
	if (count < length) {
305
		if (count == 1) return; // no need to continue since only 1 inherited method is left
320
		if (count == 1) return; // no need to continue since only 1 inherited method is left
306
		MethodBinding[] newMethods = new MethodBinding[count];
321
		MethodBinding[] newMethods = new MethodBinding[count];
Lines 552-565 Link Here
552
	// one has type variables and substituteTwo did not pass bounds check in computeSubstituteMethod()
567
	// one has type variables and substituteTwo did not pass bounds check in computeSubstituteMethod()
553
	return one.typeVariables != Binding.NO_TYPE_VARIABLES && !(substituteTwo instanceof ParameterizedGenericMethodBinding);
568
	return one.typeVariables != Binding.NO_TYPE_VARIABLES && !(substituteTwo instanceof ParameterizedGenericMethodBinding);
554
}
569
}
570
// caveat: returns false if a method is implemented but needs that a bridge 
571
//         method be generated
555
boolean isInterfaceMethodImplemented(MethodBinding inheritedMethod, MethodBinding existingMethod, ReferenceBinding superType) {
572
boolean isInterfaceMethodImplemented(MethodBinding inheritedMethod, MethodBinding existingMethod, ReferenceBinding superType) {
556
	if (inheritedMethod.original() != inheritedMethod && existingMethod.declaringClass.isInterface())
573
	if (inheritedMethod.original() != inheritedMethod && existingMethod.declaringClass.isInterface())
557
		return false; // must hold onto ParameterizedMethod to see if a bridge method is necessary
574
		return false; // must hold onto ParameterizedMethod to see if a bridge method is necessary
558
575
559
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
576
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
560
	return inheritedMethod != null
577
	return inheritedMethod != null
561
		&& (inheritedMethod.returnType == existingMethod.returnType ||
578
		&& inheritedMethod.returnType == existingMethod.returnType
562
				inheritedMethod.returnType.isCompatibleWith(inheritedMethod.returnType))
563
		&& super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType);
579
		&& super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType);
564
}
580
}
565
SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) {
581
SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) {

Return to bug 168331