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

Method isFunctionalInterface

java/org/apache/el/lang/ELSupport.java:763–787  ·  view source on GitHub ↗
(Class<?> type)

Source from the content-addressed store, hash-verified

761 * Copied to jakarta.el.ELContext - keep in sync
762 */
763 static boolean isFunctionalInterface(Class<?> type) {
764
765 if (!type.isInterface()) {
766 return false;
767 }
768
769 boolean foundAbstractMethod = false;
770 Method[] methods = type.getMethods();
771 for (Method method : methods) {
772 if (Modifier.isAbstract(method.getModifiers())) {
773 // Abstract methods that override one of the public methods
774 // of Object don't count
775 if (overridesObjectMethod(method)) {
776 continue;
777 }
778 if (foundAbstractMethod) {
779 // Found more than one
780 return false;
781 } else {
782 foundAbstractMethod = true;
783 }
784 }
785 }
786 return foundAbstractMethod;
787 }
788
789
790 /*

Calls 2

overridesObjectMethodMethod · 0.95
isAbstractMethod · 0.80