(Class<?> type, Object base, Method m)
| 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, |
no test coverage detected