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

Method getValue

java/jakarta/el/StaticFieldELResolver.java:42–68  ·  view source on GitHub ↗
(ELContext context, Object base, Object property)

Source from the content-addressed store, hash-verified

40 }
41
42 @Override
43 public Object getValue(ELContext context, Object base, Object property) {
44 Objects.requireNonNull(context);
45
46 if (base instanceof ELClass && property instanceof String name) {
47 context.setPropertyResolved(base, property);
48
49 Class<?> clazz = ((ELClass) base).getKlass();
50 Exception exception = null;
51 try {
52 Field field = clazz.getField(name);
53 int modifiers = field.getModifiers();
54 if (Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers) && Util.canAccess(null, field)) {
55 return field.get(null);
56 }
57 } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
58 exception = e;
59 }
60 String msg = Util.message(context, "staticFieldELResolver.notFound", name, clazz.getName());
61 if (exception == null) {
62 throw new PropertyNotFoundException(msg);
63 } else {
64 throw new PropertyNotFoundException(msg, exception);
65 }
66 }
67 return null;
68 }
69
70
71 @Override

Callers 5

testGetValue01Method · 0.95
testGetValue02Method · 0.95
testGetValue09Method · 0.95
doNegativeTestMethod · 0.95
doThrowableTestMethod · 0.95

Calls 7

canAccessMethod · 0.95
messageMethod · 0.95
getKlassMethod · 0.80
getMethod · 0.65
getNameMethod · 0.65
setPropertyResolvedMethod · 0.45
getFieldMethod · 0.45

Tested by 5

testGetValue01Method · 0.76
testGetValue02Method · 0.76
testGetValue09Method · 0.76
doNegativeTestMethod · 0.76
doThrowableTestMethod · 0.76