public static Method findMethod(Class<?> type,String name,Class<?>... args) throws NoSuchMethodException {
  if (name == null) {
    throw new IllegalArgumentException("Method name is not set");
  }
  PrimitiveWrapperMap.replacePrimitivesWithWrappers(args);
  Signature signature=new Signature(type,name,args);
  try {
    Method method=CACHE.get(signature);
    return (method == null) || isPackageAccessible(method.getDeclaringClass()) ? method : CACHE.create(signature);
  }
 catch (  SignatureException exception) {
    throw exception.toNoSuchMethodException("Method '" + name + "' is not found");
  }
}

public static Method findMethod ( Class < ? > type , String name , Class < ? > ... args ) throws NoSuchMethodException { if ( name == null ) { throw new IllegalArgumentException ( "Method name is not set" ) ; } PrimitiveWrapperMap . replacePrimitivesWithWrappers ( args ) ; Signature signature = new Signature ( type , name , args ) ; try { Method method = CACHE . get ( signature ) ; return ( method == null ) || isPackageAccessible ( method . getDeclaringClass ( ) ) ? method : CACHE . create ( signature ) ; } catch ( SignatureException exception ) { throw exception . toNoSuchMethodException ( "Method '" + name + "' is not found" ) ; } }
finds public method ( static or non - static ) that is accessible from public class .
