boolean missingElementsHaveProblems,
char[] castedReceiver,
int receiverStart,
int receiverEnd) {
ObjectVector newMethodsFound = new ObjectVector();
// Inherited methods which are hidden by subclasses are filtered out
// No visibility checks can be performed without the scope & invocationSite
int methodLength = methodName.length;
int minTypeArgLength = typeArgTypes == null ? 0 : typeArgTypes.length;
int minArgLength = argTypes == null ? 0 : argTypes.length;
next : for (int f = methods.length; --f >= 0;) {
MethodBinding method = methods[f];
if (method.isSynthetic()) continue next;
if (method.isDefaultAbstract()) continue next;
if (method.isConstructor()) continue next;
if (this.options.checkDeprecation &&
method.isViewedAsDeprecated() &&
!scope.isDefinedInSameUnit(method.declaringClass))
continue next;
//TODO (david) perhaps the relevance of a void method must be lesser than other methods
//if (expectedTypesPtr > -1 && method.returnType == BaseTypes.VoidBinding) continue next;
if (onlyStaticMethods && !method.isStatic()) continue next;
if (this.options.checkVisibility
&& !method.canBeSeenBy(receiverType, invocationSite, scope)) continue next;
if(superCall && method.isAbstract()) {
methodsFound.add(new Object[]{method, receiverType});
continue next;
}
if (exactMatch) {
if (!CharOperation.equals(methodName, method.selector, false /* ignore case */)) {
continue next;
}
} else {
if (methodLength > method.selector.length) continue next;
if (!CharOperation.prefixEquals(methodName, method.selector, false /* ignore case */)
&& !(this.options.camelCaseMatch && CharOperation.camelCaseMatch(methodName, method.selector))) {
continue next;
}
}
if (minTypeArgLength != 0 && minTypeArgLength != method.typeVariables.length)
continue next;
if (minTypeArgLength != 0) {
method = scope.environment().createParameterizedGenericMethod(method, typeArgTypes);
}
if (minArgLength > method.parameters.length)
continue next;
for (int a = minArgLength; --a >= 0;){
if (argTypes[a] != null) { // can be null if it could not be resolved properly
if (!argTypes[a].isCompatibleWith(method.parameters[a])) {
continue next;
}
}
}
boolean prefixRequired = false;
for (int i = methodsFound.size; --i >= 0;) {
Object[] other = (Object[]) methodsFound.elementAt(i);
MethodBinding otherMethod = (MethodBinding) other[0];
ReferenceBinding otherReceiverType = (ReferenceBinding) other[1];
if (method == otherMethod && receiverType == otherReceiverType)
continue next;
if (CharOperation.equals(method.selector, otherMethod.selector, true)) {
if (receiverType == otherReceiverType) {
if (this.lookupEnvironment.methodVerifier().isMethodSubsignature(otherMethod, method)) {
if (!superCall || !otherMethod.declaringClass.isInterface()) {
continue next;
}
}
} else {
if (this.lookupEnvironment.methodVerifier().isMethodSubsignature(otherMethod, method)) {
if(receiverType.isAnonymousType()) continue next;
if(!superCall) {
if(!canBePrefixed) continue next;
prefixRequired = true;
}
}
}
}
}
newMethodsFound.add(new Object[]{method, receiverType});
ReferenceBinding superTypeWithSameErasure = (ReferenceBinding)receiverType.findSuperTypeOriginatingFrom(method.declaringClass);
if (method.declaringClass != superTypeWithSameErasure) {
MethodBinding[] otherMethods = superTypeWithSameErasure.getMethods(method.selector);
for (int i = 0; i < otherMethods.length; i++) {