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) { |