Skip to content

Commit

Permalink
Merge pull request junit-team#968 from stefanbirkner/category
Browse files Browse the repository at this point in the history
Avoid repeated checks.
  • Loading branch information
marcphilipp committed Dec 6, 2014
2 parents d712ef9 + 7216e4b commit 1fc1c12
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -339,12 +339,13 @@ private static boolean isAnyExcluded(Class<?> klass) {
}

private static void assertNoCategorizedDescendentsOfUncategorizeableParents(Description description) throws InitializationError {
if (!canHaveCategorizedChildren(description)) {
if (canHaveCategorizedChildren(description)) {
for (Description each : description.getChildren()) {
assertNoCategorizedDescendentsOfUncategorizeableParents(each);
}
} else {
assertNoDescendantsHaveCategoryAnnotations(description);
}
for (Description each : description.getChildren()) {
assertNoCategorizedDescendentsOfUncategorizeableParents(each);
}
}

private static void assertNoDescendantsHaveCategoryAnnotations(Description description) throws InitializationError {
Expand Down

0 comments on commit 1fc1c12

Please sign in to comment.