Permalink
Browse files

Addressed code review comments

  • Loading branch information...
1 parent e5e6153 commit a2195de0206d802322c967e62bce30e8d95496f9 @vasiliygagin committed Feb 2, 2012
@@ -4,6 +4,7 @@
import cucumber.annotation.Before;
import cucumber.annotation.Order;
import cucumber.io.ClasspathResourceLoader;
+import cucumber.runtime.Utils;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -24,9 +25,12 @@ 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.getEnclosingClass() != null && !Modifier.isStatic(candidateClass.getModifiers())
- && candidateClass != Object.class) {
+ while (candidateClass != Object.class) {
// 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()) {
@@ -2,13 +2,5 @@
import cucumber.runtime.java.ClasspathMethodScannerTest;
-/**
- * {description}
- *
- * @version $Revision$
- */
public class Stepdefs2 extends ClasspathMethodScannerTest.BaseStepDefs {
-
- public Stepdefs2() {
- }
}

0 comments on commit a2195de

Please sign in to comment.