LANG-1317: Add MethodUtils#findAnnotation and extend MethodUtils#getMethodsWithAnnotation for non-public, super-class and interface methods

fix bug introduced by last commit
This commit is contained in:
pascalschumacher 2017-04-21 10:53:17 +02:00
parent 314b6b56be
commit 8cafd87c83
1 changed files with 1 additions and 1 deletions

View File

@ -904,7 +904,7 @@ public static List<Method> getMethodsListWithAnnotation(final Class<?> cls,
Validate.isTrue(annotationCls != null, "The annotation class must not be null"); Validate.isTrue(annotationCls != null, "The annotation class must not be null");
List<Class<?>> classes = (searchSupers ? getAllSuperclassesAndInterfaces(cls) List<Class<?>> classes = (searchSupers ? getAllSuperclassesAndInterfaces(cls)
: new ArrayList<Class<?>>()); : new ArrayList<Class<?>>());
classes.add(cls); classes.add(0, cls);
final List<Method> annotatedMethods = new ArrayList<>(); final List<Method> annotatedMethods = new ArrayList<>();
for (Class<?> acls : classes) { for (Class<?> acls : classes) {
final Method[] methods = (ignoreAccess ? acls.getDeclaredMethods() : acls.getMethods()); final Method[] methods = (ignoreAccess ? acls.getDeclaredMethods() : acls.getMethods());