Skip to content

Commit

Permalink
LANG-1317: A few style corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
yasserzamani committed Mar 26, 2017
1 parent 74241a7 commit e49a3a2
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -912,14 +912,18 @@ public static List<Method> findMethodsListWithAnnotation(final Class<?> cls, fin
while (ifi < allInterfaces.size() ||
sci < allSuperclasses.size()) {
Class<?> acls;
if (ifi >= allInterfaces.size())
if (ifi >= allInterfaces.size()) {
acls = allSuperclasses.get(sci++);
else if (sci >= allSuperclasses.size())
}
else if (sci >= allSuperclasses.size()) {
acls = allInterfaces.get(ifi++);
else if (sci <= ifi)
}
else if (sci <= ifi) {
acls = allSuperclasses.get(sci++);
else
}
else {
acls = allInterfaces.get(ifi++);
}
final Method[] allMethods = acls.getDeclaredMethods();
for (final Method method : allMethods) {
if (method.getAnnotation(annotationCls) != null) {
Expand All @@ -934,6 +938,8 @@ else if (sci <= ifi)
* <p>BFS to find the annotation object that is present on the given method or any equivalent method in
* super classes and interfaces, with the given annotation type. Returns null if the annotation type was not present
* on any of them.</p>
* @param <A>
* the annotation type
* @param method
* the {@link Method} to query
* @param annotationCls
Expand All @@ -957,14 +963,18 @@ public static <A extends Annotation> A findAnnotation(final Method method, final
while (ifi < allInterfaces.size() ||
sci < allSuperclasses.size()) {
Class<?> acls;
if(ifi >= allInterfaces.size())
if(ifi >= allInterfaces.size()) {
acls = allSuperclasses.get(sci++);
else if(sci >= allSuperclasses.size())
}
else if(sci >= allSuperclasses.size()) {
acls = allInterfaces.get(ifi++);
else if(ifi <= sci)
}
else if(ifi <= sci) {
acls = allInterfaces.get(ifi++);
else
}
else {
acls = allSuperclasses.get(sci++);
}
Method equivalentMethod = null;
try {
equivalentMethod = acls.getDeclaredMethod(method.getName(), method.getParameterTypes());
Expand All @@ -973,8 +983,9 @@ else if(ifi <= sci)
}
if(equivalentMethod != null) {
annotation = equivalentMethod.getAnnotation(annotationCls);
if(annotation != null)
if(annotation != null) {
break;
}
}
}
}
Expand Down

0 comments on commit e49a3a2

Please sign in to comment.