MCPcopy Index your code
hub / github.com/apache/groovy / pickStaticMethod

Method pickStaticMethod

src/main/java/groovy/lang/MetaClassImpl.java:1726–1751  ·  view source on GitHub ↗
(final String methodName, final Class<?>[] argumentTypes)

Source from the content-addressed store, hash-verified

1724 }
1725
1726 private MetaMethod pickStaticMethod(final String methodName, final Class<?>[] argumentTypes) throws MethodSelectionException {
1727 MetaMethod method = null;
1728 MethodSelectionException mse = null;
1729 Object methods = getStaticMethods(theClass, methodName);
1730
1731 if (!(methods instanceof FastArray) || !((FastArray) methods).isEmpty()) {
1732 try {
1733 method = (MetaMethod) chooseMethod(methodName, methods, argumentTypes);
1734 } catch (MethodSelectionException msex) {
1735 mse = msex;
1736 }
1737 }
1738 if (method == null && theClass != Class.class) {
1739 MetaClass cmc = registry.getMetaClass(Class.class);
1740 method = cmc.pickMethod(methodName, argumentTypes);
1741 }
1742 if (method == null) {
1743 method = (MetaMethod) chooseMethod(methodName, methods, argumentTypes);
1744 }
1745
1746 if (method == null && mse != null) {
1747 throw mse;
1748 } else {
1749 return method;
1750 }
1751 }
1752
1753 /** {@inheritDoc} */
1754 @Override

Callers 2

getStaticMetaMethodMethod · 0.95
retrieveStaticMethodMethod · 0.95

Calls 5

getStaticMethodsMethod · 0.95
chooseMethodMethod · 0.95
pickMethodMethod · 0.95
getMetaClassMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected