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

Method setValue

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

Source from the content-addressed store, hash-verified

95 }
96
97 @Override
98 public void setValue(ELContext context, Object base, Object property, Object value) {
99 Objects.requireNonNull(context);
100
101 if (base != null && base.getClass().isArray()) {
102 context.setPropertyResolved(base, property);
103
104 if (LENGTH_PROPERTY_NAME.equals(property)) {
105 throw new PropertyNotWritableException(
106 Util.message(context, "propertyNotWritable", base.getClass().getName(), property));
107 }
108
109 if (this.readOnly) {
110 throw new PropertyNotWritableException(
111 Util.message(context, "resolverNotWritable", base.getClass().getName()));
112 }
113
114 int idx = coerce(property);
115 checkBounds(base, idx);
116 if (value != null && !Util.isAssignableFrom(value.getClass(), base.getClass().getComponentType())) {
117 throw new ClassCastException(Util.message(context, "objectNotAssignable", value.getClass().getName(),
118 base.getClass().getComponentType().getName()));
119 }
120 Array.set(base, idx, value);
121 }
122 }
123
124 @Override
125 public boolean isReadOnly(ELContext context, Object base, Object property) {

Callers 9

testSetValue01Method · 0.95
testSetValue03Method · 0.95
testSetValue04Method · 0.95
testSetValue05Method · 0.95
testSetValue06Method · 0.95
testSetValue07Method · 0.95
testSetValue08Method · 0.95
testSetValue09Method · 0.95
doNegativeTestMethod · 0.95

Calls 9

messageMethod · 0.95
coerceMethod · 0.95
checkBoundsMethod · 0.95
isAssignableFromMethod · 0.95
isArrayMethod · 0.80
equalsMethod · 0.65
getNameMethod · 0.65
setMethod · 0.65
setPropertyResolvedMethod · 0.45

Tested by 9

testSetValue01Method · 0.76
testSetValue03Method · 0.76
testSetValue04Method · 0.76
testSetValue05Method · 0.76
testSetValue06Method · 0.76
testSetValue07Method · 0.76
testSetValue08Method · 0.76
testSetValue09Method · 0.76
doNegativeTestMethod · 0.76