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

Method getValue

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

Source from the content-addressed store, hash-verified

76 }
77
78 @Override
79 public Object getValue(ELContext context, Object base, Object property) {
80 Objects.requireNonNull(context);
81
82 if (base != null && base.getClass().isArray()) {
83 context.setPropertyResolved(base, property);
84 if (LENGTH_PROPERTY_NAME.equals(property)) {
85 return Integer.valueOf(Array.getLength(base));
86 }
87 int idx = coerce(property);
88 if (idx < 0 || idx >= Array.getLength(base)) {
89 return null;
90 }
91 return Array.get(base, idx);
92 }
93
94 return null;
95 }
96
97 @Override
98 public void setValue(ELContext context, Object base, Object property, Object value) {

Callers 12

testGetValue01Method · 0.95
testGetValue03Method · 0.95
testGetValue05Method · 0.95
testSetValue04Method · 0.95
doNegativeTestMethod · 0.95

Calls 7

coerceMethod · 0.95
isArrayMethod · 0.80
equalsMethod · 0.65
getLengthMethod · 0.65
getMethod · 0.65
setPropertyResolvedMethod · 0.45
valueOfMethod · 0.45

Tested by 12

testGetValue01Method · 0.76
testGetValue03Method · 0.76
testGetValue05Method · 0.76
testSetValue04Method · 0.76
doNegativeTestMethod · 0.76