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

Method coerce

java/jakarta/el/ArrayELResolver.java:159–173  ·  view source on GitHub ↗
(Object property)

Source from the content-addressed store, hash-verified

157 }
158
159 private static int coerce(Object property) {
160 if (property instanceof Number) {
161 return ((Number) property).intValue();
162 }
163 if (property instanceof Character) {
164 return ((Character) property).charValue();
165 }
166 if (property instanceof Boolean) {
167 return ((Boolean) property).booleanValue() ? 1 : 0;
168 }
169 if (property instanceof String) {
170 return Integer.parseInt((String) property);
171 }
172 throw new IllegalArgumentException(property != null ? property.toString() : "null");
173 }
174
175}

Callers 4

getTypeMethod · 0.95
getValueMethod · 0.95
setValueMethod · 0.95
isReadOnlyMethod · 0.95

Calls 3

toStringMethod · 0.65
booleanValueMethod · 0.45
parseIntMethod · 0.45

Tested by

no test coverage detected