MCPcopy Create free account
hub / github.com/apache/tomcat / isFunctionalInterface

Method isFunctionalInterface

java/jakarta/el/ELContext.java:383–407  ·  view source on GitHub ↗
(Class<?> type)

Source from the content-addressed store, hash-verified

381 * Copied from org.apache.el.lang.ELSupport - keep in sync
382 */
383 static boolean isFunctionalInterface(Class<?> type) {
384
385 if (!type.isInterface()) {
386 return false;
387 }
388
389 boolean foundAbstractMethod = false;
390 Method[] methods = type.getMethods();
391 for (Method method : methods) {
392 if (Modifier.isAbstract(method.getModifiers())) {
393 // Abstract methods that override one of the public methods
394 // of Object don't count
395 if (overridesObjectMethod(method)) {
396 continue;
397 }
398 if (foundAbstractMethod) {
399 // Found more than one
400 return false;
401 } else {
402 foundAbstractMethod = true;
403 }
404 }
405 }
406 return foundAbstractMethod;
407 }
408
409
410 /*

Callers 1

convertToTypeMethod · 0.95

Calls 2

overridesObjectMethodMethod · 0.95
isAbstractMethod · 0.80

Tested by

no test coverage detected