Polishing

This commit is contained in:
Juergen Hoeller
2018-03-31 17:49:21 +02:00
parent 4454ffd2b1
commit 912c270f2b
6 changed files with 27 additions and 24 deletions

View File

@@ -592,7 +592,8 @@ public abstract class AnnotationUtils {
}
static Set<Method> getAnnotatedMethodsInBaseType(Class<?> baseType) {
if (ClassUtils.isJavaLanguageInterface(baseType)) {
boolean ifcCheck = baseType.isInterface();
if (ifcCheck && ClassUtils.isJavaLanguageInterface(baseType)) {
return Collections.emptySet();
}
@@ -600,10 +601,13 @@ public abstract class AnnotationUtils {
if (annotatedMethods != null) {
return annotatedMethods;
}
Method[] methods = (baseType.isInterface() ? baseType.getMethods() : baseType.getDeclaredMethods());
Method[] methods = (ifcCheck ? baseType.getMethods() : baseType.getDeclaredMethods());
for (Method baseMethod : methods) {
try {
if (hasSearchableAnnotations(baseMethod)) {
// Public methods on interfaces (including interface hierarchy),
// non-private (and therefore overridable) methods on base classes
if ((ifcCheck || !Modifier.isPrivate(baseMethod.getModifiers())) &&
hasSearchableAnnotations(baseMethod)) {
if (annotatedMethods == null) {
annotatedMethods = new HashSet<>();
}