Lite configuration candidate check defensively handles method introspection failure

Issue: SPR-13091
This commit is contained in:
Juergen Hoeller 2015-06-02 14:18:00 +02:00
parent 8c337a48a9
commit 4f1286a4c3
1 changed files with 13 additions and 1 deletions

View File

@ -161,12 +161,24 @@ abstract class ConfigurationClassUtils {
if (metadata.isInterface()) {
return false;
}
// Any of the typical annotations found?
for (String indicator : candidateIndicators) {
if (metadata.isAnnotated(indicator)) {
return true;
}
}
return metadata.hasAnnotatedMethods(Bean.class.getName());
// Finally, let's look for @Bean methods...
try {
return metadata.hasAnnotatedMethods(Bean.class.getName());
}
catch (Throwable ex) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to introspect @Bean methods on class [" + metadata.getClass() + "]: " + ex);
}
return false;
}
}
/**