MCPcopy Index your code
hub / github.com/apache/tomcat / getMethod

Method getMethod

java/jakarta/el/Util.java:438–469  ·  view source on GitHub ↗
(Class<?> type, Object base, Method m)

Source from the content-addressed store, hash-verified

436 * This method duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync.
437 */
438 static Method getMethod(Class<?> type, Object base, Method m) {
439 if (m == null || (Modifier.isPublic(type.getModifiers()) &&
440 (Modifier.isStatic(m.getModifiers()) && canAccess(null, m) || canAccess(base, m)))) {
441 return m;
442 }
443 Class<?>[] interfaces = type.getInterfaces();
444 Method mp;
445 for (Class<?> iface : interfaces) {
446 try {
447 mp = iface.getMethod(m.getName(), m.getParameterTypes());
448 mp = getMethod(mp.getDeclaringClass(), base, mp);
449 if (mp != null) {
450 return mp;
451 }
452 } catch (NoSuchMethodException e) {
453 // Ignore
454 }
455 }
456 Class<?> sup = type.getSuperclass();
457 if (sup != null) {
458 try {
459 mp = sup.getMethod(m.getName(), m.getParameterTypes());
460 mp = getMethod(mp.getDeclaringClass(), base, mp);
461 if (mp != null) {
462 return mp;
463 }
464 } catch (NoSuchMethodException e) {
465 // Ignore
466 }
467 }
468 return null;
469 }
470
471
472 static Constructor<?> findConstructor(ELContext context, Class<?> clazz, Class<?>[] paramTypes,

Callers 4

findMethodMethod · 0.95
isReadOnlyMethod · 0.95
writeMethod · 0.95
readMethod · 0.95

Calls 5

canAccessMethod · 0.95
getInterfacesMethod · 0.80
getMethodMethod · 0.65
getNameMethod · 0.65
getParameterTypesMethod · 0.45

Tested by

no test coverage detected