@Test void shouldReturnEmptyMethodListForNoMethodScanClass() { assertThat(ReflectionUtils.safeGetDeclaredMethods(NoMethodScanClass.class), emptyArray()); assertThat(ReflectionUtils.safeGetDeclaredMethods(ReflectionsTestClass.class).length, greaterThanOrEqualTo(4)); }
public static Method[] safeGetDeclaredMethods(Class<?> clazz) { return clazz.isAnnotationPresent(NoMethodScan.class) ? new Method[0] : clazz.getDeclaredMethods(); }
ReflectionUtils { public static Method[] safeGetDeclaredMethods(Class<?> clazz) { return clazz.isAnnotationPresent(NoMethodScan.class) ? new Method[0] : clazz.getDeclaredMethods(); } }
ReflectionUtils { public static Method[] safeGetDeclaredMethods(Class<?> clazz) { return clazz.isAnnotationPresent(NoMethodScan.class) ? new Method[0] : clazz.getDeclaredMethods(); } private  ReflectionUtils(); }
ReflectionUtils { public static Method[] safeGetDeclaredMethods(Class<?> clazz) { return clazz.isAnnotationPresent(NoMethodScan.class) ? new Method[0] : clazz.getDeclaredMethods(); } private  ReflectionUtils(); static Object getFieldValue(Field field, Object instance); static void setField(Field field, Object instance, Object value); static Object invokeMethod(Method method, Object instance, Object... parameters); static T newInstance(Constructor<T> constructor, Object... parameters); @Nullable static Class<?> getGenericType(@Nullable Type genericType); @Nullable static Class<?> getCollectionType(Class<?> mainType, @Nullable Type genericType); static Object toSuitableCollectionType(Class<?> rawType, Set<T> result); static Method[] safeGetDeclaredMethods(Class<?> clazz); static Field[] safeGetDeclaredFields(Class<?> clazz); }
ReflectionUtils { public static Method[] safeGetDeclaredMethods(Class<?> clazz) { return clazz.isAnnotationPresent(NoMethodScan.class) ? new Method[0] : clazz.getDeclaredMethods(); } private  ReflectionUtils(); static Object getFieldValue(Field field, Object instance); static void setField(Field field, Object instance, Object value); static Object invokeMethod(Method method, Object instance, Object... parameters); static T newInstance(Constructor<T> constructor, Object... parameters); @Nullable static Class<?> getGenericType(@Nullable Type genericType); @Nullable static Class<?> getCollectionType(Class<?> mainType, @Nullable Type genericType); static Object toSuitableCollectionType(Class<?> rawType, Set<T> result); static Method[] safeGetDeclaredMethods(Class<?> clazz); static Field[] safeGetDeclaredFields(Class<?> clazz);  }