MCPcopy Index your code
hub / github.com/beanshell/beanshell / classContainsMethod

Method classContainsMethod

src/bsh/ClassGeneratorUtil.java:600–623  ·  view source on GitHub ↗
(Class clas, String methodName, String[] paramTypes)

Source from the content-addressed store, hash-verified

598
599
600 boolean classContainsMethod(Class clas, String methodName, String[] paramTypes) {
601 while (clas != null) {
602 Method[] methods = clas.getDeclaredMethods();
603 for (Method method : methods) {
604 if (method.getName().equals(methodName)) {
605 String[] methodParamTypes = getTypeDescriptors(method.getParameterTypes());
606 boolean found = true;
607 for (int j = 0; j < methodParamTypes.length; j++) {
608 if (!paramTypes[j].equals(methodParamTypes[j])) {
609 found = false;
610 break;
611 }
612 }
613 if (found) {
614 return true;
615 }
616 }
617 }
618
619 clas = clas.getSuperclass();
620 }
621
622 return false;
623 }
624
625
626 /**

Callers 1

generateClassMethod · 0.95

Calls 5

getTypeDescriptorsMethod · 0.95
getDeclaredMethodsMethod · 0.80
equalsMethod · 0.45
getNameMethod · 0.45
getParameterTypesMethod · 0.45

Tested by

no test coverage detected