[bs-73] Tweak algorithm for detecting anonymous classes

Apparently an anonymous class in Groovy is no anonymous in the compiled code,
so we need another heuristic.  We now check for non-existence of public
constructors (if there are none then there's no point regsistering that
class with an application context).

[#48718891]
pull/1/merge
Dave Syer 12 years ago
parent a2d328ae3a
commit d82c50804f

@ -156,7 +156,8 @@ class BeanDefinitionLoader {
private boolean isComponent(Class<?> type) {
// Nested anonymous classes are not eligible for registration, nor are groovy
// closures
if (type.isAnonymousClass() || type.getName().contains("$_closure")) {
if (type.isAnonymousClass() || type.getName().contains("$_closure")
|| type.getConstructors() == null || type.getConstructors().length == 0) {
return false;
}
return true;

Loading…
Cancel
Save