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

Method getType

java/jakarta/el/ArrayELResolver.java:47–76  ·  view source on GitHub ↗
(ELContext context, Object base, Object property)

Source from the content-addressed store, hash-verified

45 }
46
47 @Override
48 public Class<?> getType(ELContext context, Object base, Object property) {
49 Objects.requireNonNull(context);
50
51 if (base != null && base.getClass().isArray()) {
52 context.setPropertyResolved(base, property);
53
54 if (LENGTH_PROPERTY_NAME.equals(property)) {
55 // Always read-only
56 return null;
57 }
58
59 try {
60 int idx = coerce(property);
61 checkBounds(base, idx);
62 } catch (IllegalArgumentException e) {
63 // ignore
64 }
65 /*
66 * The resolver may have been created in read-only mode but the array and its elements will always be
67 * read-write.
68 */
69 if (readOnly) {
70 return null;
71 }
72 return base.getClass().getComponentType();
73 }
74
75 return null;
76 }
77
78 @Override
79 public Object getValue(ELContext context, Object base, Object property) {

Callers 6

testGetType01Method · 0.95
testGetType03Method · 0.95
testGetType04Method · 0.95
testGetType05Method · 0.95
testGetType06Method · 0.95
doNegativeTestMethod · 0.95

Calls 5

coerceMethod · 0.95
checkBoundsMethod · 0.95
isArrayMethod · 0.80
equalsMethod · 0.65
setPropertyResolvedMethod · 0.45

Tested by 6

testGetType01Method · 0.76
testGetType03Method · 0.76
testGetType04Method · 0.76
testGetType05Method · 0.76
testGetType06Method · 0.76
doNegativeTestMethod · 0.76