static MethodBase findMostDerivedNewSlotMethod(final MethodBase[] match, final int cMatches) { int deepestHierarchy = 0; MethodBase methodWithDeepestHierarchy = null; for (int i = 0; i < cMatches; i++) { // Calculate the depth of the hierarchy of the declaring type of the // current method. final int currentHierarchyDepth = getHierarchyDepth(match[i].getDeclaringType()); // The two methods have the same name, signature, and hierarchy depth. // This can only happen if at least one is vararg or generic. if (currentHierarchyDepth == deepestHierarchy) { throw Error.ambiguousMatch(); } // Check to see if this method is on the most derived class. if (currentHierarchyDepth > deepestHierarchy) { deepestHierarchy = currentHierarchyDepth; methodWithDeepestHierarchy = match[i]; } } return methodWithDeepestHierarchy; }
static MethodBase findMostDerivedNewSlotMethod(final MethodBase[] match, final int cMatches) { int deepestHierarchy = 0; MethodBase methodWithDeepestHierarchy = null; for (int i = 0; i < cMatches; i++) { // Calculate the depth of the hierarchy of the declaring type of the // current method. final int currentHierarchyDepth = getHierarchyDepth(match[i].getDeclaringType()); // The two methods have the same name, signature, and hierarchy depth. // This can only happen if at least one is vararg or generic. if (currentHierarchyDepth == deepestHierarchy) { throw Error.ambiguousMatch(); } // Check to see if this method is on the most derived class. if (currentHierarchyDepth > deepestHierarchy) { deepestHierarchy = currentHierarchyDepth; methodWithDeepestHierarchy = match[i]; } } return methodWithDeepestHierarchy; }
static MethodBase findMostDerivedNewSlotMethod(final MethodBase[] match, final int cMatches) { int deepestHierarchy = 0; MethodBase methodWithDeepestHierarchy = null; for (int i = 0; i < cMatches; i++) { // Calculate the depth of the hierarchy of the declaring type of the // current method. final int currentHierarchyDepth = getHierarchyDepth(match[i].getDeclaringType()); // The two methods have the same name, signature, and hierarchy depth. // This can only happen if at least one is vararg or generic. if (currentHierarchyDepth == deepestHierarchy) { throw Error.ambiguousMatch(); } // Check to see if this method is on the most derived class. if (currentHierarchyDepth > deepestHierarchy) { deepestHierarchy = currentHierarchyDepth; methodWithDeepestHierarchy = match[i]; } } return methodWithDeepestHierarchy; }