Lines 635-641
Link Here
|
635 |
if (method.declaringClass == null || this.allSuperDeclaringTypeNames == null) { |
635 |
if (method.declaringClass == null || this.allSuperDeclaringTypeNames == null) { |
636 |
declaringLevel = INACCURATE_MATCH; |
636 |
declaringLevel = INACCURATE_MATCH; |
637 |
} else { |
637 |
} else { |
638 |
if (resolveLevelAsSuperInvocation(methodReceiverType)) { |
638 |
if (resolveLevelAsSuperInvocation(methodReceiverType, method.parameters)) { |
639 |
declaringLevel = methodLevel // since this is an ACCURATE_MATCH so return the possibly weaker match |
639 |
declaringLevel = methodLevel // since this is an ACCURATE_MATCH so return the possibly weaker match |
640 |
| SUPER_INVOCATION_FLAVOR; // this is an overridden method => add flavor to returned level |
640 |
| SUPER_INVOCATION_FLAVOR; // this is an overridden method => add flavor to returned level |
641 |
} |
641 |
} |
Lines 723-729
Link Here
|
723 |
* Return whether the given type binding or one of its possible super interfaces |
723 |
* Return whether the given type binding or one of its possible super interfaces |
724 |
* matches a type in the declaring type names hierarchy. |
724 |
* matches a type in the declaring type names hierarchy. |
725 |
*/ |
725 |
*/ |
726 |
protected boolean resolveLevelAsSuperInvocation(ReferenceBinding type) { |
726 |
protected boolean resolveLevelAsSuperInvocation(ReferenceBinding type, TypeBinding[] argumentTypes) { |
727 |
char[][] compoundName = type.compoundName; |
727 |
char[][] compoundName = type.compoundName; |
728 |
for (int i = 0, max = this.allSuperDeclaringTypeNames.length; i < max; i++) { |
728 |
for (int i = 0, max = this.allSuperDeclaringTypeNames.length; i < max; i++) { |
729 |
if (CharOperation.equals(this.allSuperDeclaringTypeNames[i], compoundName)) { |
729 |
if (CharOperation.equals(this.allSuperDeclaringTypeNames[i], compoundName)) { |
Lines 736-743
Link Here
|
736 |
ReferenceBinding[] interfaces = type.superInterfaces(); |
736 |
ReferenceBinding[] interfaces = type.superInterfaces(); |
737 |
if (interfaces == null) return false; |
737 |
if (interfaces == null) return false; |
738 |
for (int i = 0; i < interfaces.length; i++) { |
738 |
for (int i = 0; i < interfaces.length; i++) { |
739 |
if (resolveLevelAsSuperInvocation(interfaces[i])) { |
739 |
// need to verify if method may be overridden |
740 |
return true; |
740 |
MethodBinding[] methods = interfaces[i].getMethods(this.pattern.selector); |
|
|
741 |
for (int j=0, length=methods.length; j<length; j++) { |
742 |
MethodBinding method = methods[j]; |
743 |
TypeBinding[] parameters = method.parameters; |
744 |
if (argumentTypes.length == parameters.length) { |
745 |
boolean found = true; |
746 |
for (int k=0,l=parameters.length; k<l; k++) { |
747 |
if (parameters[k].erasure() != argumentTypes[k].erasure()) { |
748 |
found = false; |
749 |
break; |
750 |
} |
751 |
} |
752 |
if (found) { // current method match in hierarchy |
753 |
if (resolveLevelAsSuperInvocation(interfaces[i], argumentTypes)) { |
754 |
return true; |
755 |
} |
756 |
} |
757 |
} |
741 |
} |
758 |
} |
742 |
} |
759 |
} |
743 |
} |
760 |
} |