@Test public void testIllegalArgumentExceptionGetMethodAndMakeAccessible() { exception.expect(IllegalArgumentException.class); Method m = reflectionUtils.getMethodAndMakeAccessible(ReflectTester.class, "getBar"); }
public static Method getMethodAndMakeAccessible(Class<?> clazz, String name, Class<?>... arguments) { try { Method m = org.springframework.util.ReflectionUtils.findMethod(clazz, name, arguments); m.setAccessible(true); return m; } catch (Exception e) { throw new IllegalArgumentException(e); } }
ReflectionUtils { public static Method getMethodAndMakeAccessible(Class<?> clazz, String name, Class<?>... arguments) { try { Method m = org.springframework.util.ReflectionUtils.findMethod(clazz, name, arguments); m.setAccessible(true); return m; } catch (Exception e) { throw new IllegalArgumentException(e); } } }
ReflectionUtils { public static Method getMethodAndMakeAccessible(Class<?> clazz, String name, Class<?>... arguments) { try { Method m = org.springframework.util.ReflectionUtils.findMethod(clazz, name, arguments); m.setAccessible(true); return m; } catch (Exception e) { throw new IllegalArgumentException(e); } }  }
ReflectionUtils { public static Method getMethodAndMakeAccessible(Class<?> clazz, String name, Class<?>... arguments) { try { Method m = org.springframework.util.ReflectionUtils.findMethod(clazz, name, arguments); m.setAccessible(true); return m; } catch (Exception e) { throw new IllegalArgumentException(e); } }  static Method getMethodAndMakeAccessible(Class<?> clazz, String name, Class<?>... arguments); static Field getFieldAndMakeAccessible(Class<?> clazz, String fieldName); }
ReflectionUtils { public static Method getMethodAndMakeAccessible(Class<?> clazz, String name, Class<?>... arguments) { try { Method m = org.springframework.util.ReflectionUtils.findMethod(clazz, name, arguments); m.setAccessible(true); return m; } catch (Exception e) { throw new IllegalArgumentException(e); } }  static Method getMethodAndMakeAccessible(Class<?> clazz, String name, Class<?>... arguments); static Field getFieldAndMakeAccessible(Class<?> clazz, String fieldName);  }