MCPcopy Index your code
hub / github.com/clojure/clojure / maybeFIMethod

Method maybeFIMethod

src/jvm/clojure/lang/Compiler.java:1660–1673  ·  view source on GitHub ↗
(Class target)

Source from the content-addressed store, hash-verified

1658 // 1) Target is a functional interface and not already implemented by AFn
1659 // 2) Target method matches one of our fn invoker methods (0 <= arity <= 10)
1660 static java.lang.reflect.Method maybeFIMethod(Class target) {
1661 if (target != null && target.isAnnotationPresent(FunctionalInterface.class)
1662 && !AFN_FIS.contains(target)) {
1663
1664 java.lang.reflect.Method[] methods = target.getMethods();
1665 for (java.lang.reflect.Method method : methods) {
1666 if (method.getParameterCount() >= 0 && method.getParameterCount() <= 10
1667 && Modifier.isAbstract(method.getModifiers())
1668 && !OBJECT_METHODS.contains(method.getName()))
1669 return method;
1670 }
1671 }
1672 return null;
1673 }
1674
1675 // Invokers support only long, double, Object params; widen numerics
1676 private static Class toInvokerParamType(Class c) {

Callers 3

maybeEmitFIAdapterMethod · 0.95
boxArgMethod · 0.80
paramArgTypeMatchMethod · 0.80

Calls 3

getMethodsMethod · 0.80
containsMethod · 0.65
getNameMethod · 0.65

Tested by

no test coverage detected