MCPcopy Create free account
hub / github.com/apache/tomcat / isCoercibleFrom

Method isCoercibleFrom

java/jakarta/el/Util.java:404–415  ·  view source on GitHub ↗
(ELContext context, Object src, Class<?> target)

Source from the content-addressed store, hash-verified

402 * This method duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync.
403 */
404 private static boolean isCoercibleFrom(ELContext context, Object src, Class<?> target) {
405 /*
406 * TODO: This isn't pretty but it works. Significant refactoring would be required to avoid the exception. See
407 * also OptionalELResolver.convertToType().
408 */
409 try {
410 context.convertToType(src, target);
411 } catch (ELException e) {
412 return false;
413 }
414 return true;
415 }
416
417
418 private static Class<?>[] getTypesFromValues(Object[] values) {

Callers 1

findWrapperMethod · 0.95

Calls 1

convertToTypeMethod · 0.45

Tested by

no test coverage detected