Skip to content

Commit

Permalink
Any source applicable tests should be ANDed together not ORed / fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Dec 16, 2022
1 parent dbf7dba commit ca25377
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions rewrite-core/src/main/java/org/openrewrite/RecipeScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,17 @@ default <S extends SourceFile> List<S> scheduleVisit(RecipeRunStats runStats,
((WatchableExecutionContext) ctx).resetHasNewMessages();
}
try {
for (S s : before) {
for (Recipe r : recipeStack) {
for (TreeVisitor<?, ExecutionContext> applicableTest : r.getApplicableTests()) {
if (applicableTest.visit(s, ctx) == s) {
return before;
for (Recipe r : recipeStack) {
nextTest:
for (TreeVisitor<?, ExecutionContext> applicableTest : r.getApplicableTests()) {
for (S s : before) {
if (applicableTest.visit(s, ctx) != s) {
continue nextTest;
}
}
if (!before.isEmpty()) {
return before;
}
}
}
} catch (Throwable t) {
Expand Down

0 comments on commit ca25377

Please sign in to comment.