Skip to content

Commit

Permalink
Using new Utils.isInstantiable
Browse files Browse the repository at this point in the history
  • Loading branch information
vasiliygagin committed Feb 2, 2012
1 parent 3e970a5 commit b446c0b
Showing 1 changed file with 1 addition and 5 deletions.
Expand Up @@ -25,12 +25,8 @@ public void scan(JavaBackend javaBackend, List<String> gluePaths) {
for (String gluePath : gluePaths) {
String packageName = gluePath.replace('/', '.').replace('\\', '.'); // Sometimes the gluePath will be a path, not a package
for (Class<?> candidateClass : resourceLoader.getDescendants(Object.class, packageName)) {
while (candidateClass != Object.class) {
while (candidateClass != Object.class && !Utils.isInstantiable(candidateClass)) {
// those can't be instantiated without container class present.
boolean nonStaticInnerClass = candidateClass.getEnclosingClass() != null && !Modifier.isStatic(candidateClass.getModifiers());
if (!nonStaticInnerClass && Utils.isInstantiable(candidateClass)) {
break;
}
candidateClass = candidateClass.getSuperclass();
}
for (Method method : candidateClass.getMethods()) {
Expand Down

0 comments on commit b446c0b

Please sign in to comment.