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

Method isAssignableFrom

java/jakarta/el/Util.java:367–398  ·  view source on GitHub ↗
(Class<?> src, Class<?> target)

Source from the content-addressed store, hash-verified

365 * This method duplicates code in org.apache.el.util.ReflectionUtil. When making changes keep the code in sync.
366 */
367 static boolean isAssignableFrom(Class<?> src, Class<?> target) {
368 // src will always be an object
369 // Short-cut. null is always assignable to an object and in EL null
370 // can always be coerced to a valid value for a primitive
371 if (src == null) {
372 return true;
373 }
374
375 Class<?> targetClass;
376 if (target.isPrimitive()) {
377 if (target == Boolean.TYPE) {
378 targetClass = Boolean.class;
379 } else if (target == Character.TYPE) {
380 targetClass = Character.class;
381 } else if (target == Byte.TYPE) {
382 targetClass = Byte.class;
383 } else if (target == Short.TYPE) {
384 targetClass = Short.class;
385 } else if (target == Integer.TYPE) {
386 targetClass = Integer.class;
387 } else if (target == Long.TYPE) {
388 targetClass = Long.class;
389 } else if (target == Float.TYPE) {
390 targetClass = Float.class;
391 } else {
392 targetClass = Double.class;
393 }
394 } else {
395 targetClass = target;
396 }
397 return targetClass.isAssignableFrom(src);
398 }
399
400
401 /*

Callers 15

setValueMethod · 0.95
findWrapperMethod · 0.95
isServletSpecClassMethod · 0.45
invokeMethod · 0.45
isDeclaredExceptionMethod · 0.45
doTestWriterMethod · 0.45
doTestWriterErrorMethod · 0.45
awaitOnErrorMethod · 0.45
testHostMethod · 0.45
testHostTypeMethod · 0.45
getWriteMethodMethod · 0.45

Calls 1

isPrimitiveMethod · 0.80

Tested by 5

doTestWriterMethod · 0.36
doTestWriterErrorMethod · 0.36
awaitOnErrorMethod · 0.36
testHostMethod · 0.36
testHostTypeMethod · 0.36