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

Method invoke

java/jakarta/el/OptionalELResolver.java:210–225  ·  view source on GitHub ↗

{@inheritDoc} @return If the base object is an Optional and Optional#isEmpty() returns true then this method returns null. If the base object is an Optional and Optional#isPresent() returns true then

(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params)

Source from the content-addressed store, hash-verified

208 * If the base object is not an {@link Optional} then the return value is undefined.
209 */
210 @Override
211 public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) {
212 Objects.requireNonNull(context);
213
214 if (base instanceof Optional && method != null) {
215 context.setPropertyResolved(base, method);
216 if (((Optional<?>) base).isEmpty()) {
217 return null;
218 } else {
219 Object resolvedBase = ((Optional<?>) base).get();
220 return context.getELResolver().invoke(context, resolvedBase, method, paramTypes, params);
221 }
222 }
223
224 return null;
225 }
226}

Callers

nothing calls this directly

Calls 5

getMethod · 0.65
invokeMethod · 0.65
setPropertyResolvedMethod · 0.45
isEmptyMethod · 0.45
getELResolverMethod · 0.45

Tested by

no test coverage detected