From 9992c581fea019e36b44ff7eb62bd10c11ff97bb Mon Sep 17 00:00:00 2001 From: Shannon Pamperl Date: Mon, 5 Aug 2024 10:58:10 -0500 Subject: [PATCH] Only add marker to newly parsed resources to avoid adding other source set's JavaVersion markers to previously parsed source files --- .../org/openrewrite/gradle/isolated/DefaultProjectParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java b/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java index 4e100da0b..fe9e6ff0b 100644 --- a/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java +++ b/plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java @@ -826,7 +826,8 @@ public Stream parse(Project subproject, Set alreadyParsed, Exe sourceSetSourceFiles = Stream.concat( sourceSetSourceFiles, omniParser.parse(accepted, baseDir, new InMemoryExecutionContext()) - ).map(it -> it.withMarkers(it.getMarkers().add(javaVersion))); + .map(it -> it.withMarkers(it.getMarkers().add(javaVersion))) + ); alreadyParsed.addAll(accepted); sourceSetSize += accepted.size(); }