(ELContext context, Class<?> clazz, Class<?>[] paramTypes,
Object[] paramValues)
| 470 | |
| 471 | |
| 472 | static Constructor<?> findConstructor(ELContext context, Class<?> clazz, Class<?>[] paramTypes, |
| 473 | Object[] paramValues) { |
| 474 | |
| 475 | String methodName = "<init>"; |
| 476 | |
| 477 | if (clazz == null) { |
| 478 | throw new MethodNotFoundException( |
| 479 | message(null, "util.method.notfound", null, methodName, paramString(paramTypes))); |
| 480 | } |
| 481 | |
| 482 | if (paramTypes == null) { |
| 483 | paramTypes = getTypesFromValues(paramValues); |
| 484 | } |
| 485 | |
| 486 | Constructor<?>[] constructors = clazz.getConstructors(); |
| 487 | |
| 488 | List<Wrapper<Constructor<?>>> wrappers = Wrapper.wrap(constructors); |
| 489 | |
| 490 | Wrapper<Constructor<?>> wrapper = findWrapper(context, clazz, wrappers, methodName, paramTypes, paramValues); |
| 491 | |
| 492 | Constructor<?> constructor = wrapper.unWrap(); |
| 493 | |
| 494 | if (!Modifier.isPublic(clazz.getModifiers()) || !canAccess(null, constructor)) { |
| 495 | throw new MethodNotFoundException( |
| 496 | message(null, "util.method.notfound", clazz, methodName, paramString(paramTypes))); |
| 497 | } |
| 498 | |
| 499 | return constructor; |
| 500 | } |
| 501 | |
| 502 | |
| 503 | static boolean canAccess(Object base, AccessibleObject accessibleObject) { |
no test coverage detected