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

Method isAssignableFrom

java/org/apache/el/util/ReflectionUtil.java:417–448  ·  view source on GitHub ↗
(Class<?> src, Class<?> target)

Source from the content-addressed store, hash-verified

415 * This class duplicates code in jakarta.el.Util. When making changes keep the code in sync.
416 */
417 private static boolean isAssignableFrom(Class<?> src, Class<?> target) {
418 // src will always be an object
419 // Short-cut. null is always assignable to an object and in EL null
420 // can always be coerced to a valid value for a primitive
421 if (src == null) {
422 return true;
423 }
424
425 Class<?> targetClass;
426 if (target.isPrimitive()) {
427 if (target == Boolean.TYPE) {
428 targetClass = Boolean.class;
429 } else if (target == Character.TYPE) {
430 targetClass = Character.class;
431 } else if (target == Byte.TYPE) {
432 targetClass = Byte.class;
433 } else if (target == Short.TYPE) {
434 targetClass = Short.class;
435 } else if (target == Integer.TYPE) {
436 targetClass = Integer.class;
437 } else if (target == Long.TYPE) {
438 targetClass = Long.class;
439 } else if (target == Float.TYPE) {
440 targetClass = Float.class;
441 } else {
442 targetClass = Double.class;
443 }
444 } else {
445 targetClass = target;
446 }
447 return targetClass.isAssignableFrom(src);
448 }
449
450
451 /*

Callers 15

getMethodMethod · 0.95
CustomTagMethod · 0.45
checkXmlAttributesMethod · 0.45
getWriteMethodMethod · 0.45
getObjectInstanceMethod · 0.45
getObjectInstanceMethod · 0.45
isWrapperForMethod · 0.45
unwrapMethod · 0.45
isWrapperForMethod · 0.45
unwrapMethod · 0.45
isWrapperForMethod · 0.45
unwrapMethod · 0.45

Calls 1

isPrimitiveMethod · 0.80

Tested by

no test coverage detected