@Test public void testFindBestMethodWithSignature_Object() throws Exception { ReflectionHelper helper = new ReflectionHelper(FakeInterface.class); Class[] signatureSought = new Class[] {NullPointerException.class}; try { helper.findBestMethodWithSignature("method", signatureSought ); fail("exception expected"); } catch (NoSuchMethodException e) { assertEquals("method Args: [class java.lang.NullPointerException] has multiple possible signatures.", e.getMessage()); } }
public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } ReflectionHelper( Class<?> targetClass ); }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } ReflectionHelper( Class<?> targetClass ); Method findBestMethodOnTarget( String methodName, Object[] arguments ); Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ); Method findBestMethodWithSignature( String methodName, List<Class<?>> argumentsClasses ); static final Object create(String className, Collection<?> ctorObjs,
                                      final ClassLoader classLoader); static final Object create(String className, Object[] ctorObjs, Class<?>[] argTypes,
                final ClassLoader classLoader); }
ReflectionHelper { public Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ) throws NoSuchMethodException, SecurityException { List argumentClassesList = Arrays.asList(argumentsClasses); return findBestMethodWithSignature(methodName,argumentClassesList); } ReflectionHelper( Class<?> targetClass ); Method findBestMethodOnTarget( String methodName, Object[] arguments ); Method findBestMethodWithSignature( String methodName, Object[] argumentsClasses ); Method findBestMethodWithSignature( String methodName, List<Class<?>> argumentsClasses ); static final Object create(String className, Collection<?> ctorObjs,
                                      final ClassLoader classLoader); static final Object create(String className, Object[] ctorObjs, Class<?>[] argTypes,
                final ClassLoader classLoader);  }