Skip to content

Commit 8cab5ca

Browse files
committedMar 2, 2025·
Fixing recursive depth issue with files.walk

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎src/java/transform/Main.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import java.nio.file.Paths;
1414
import java.util.ArrayList;
1515
import java.util.Iterator;
16+
import java.util.List;
1617
import java.util.Properties;
18+
import java.util.stream.Collectors;
1719

1820
import javax.tools.JavaCompiler;
1921
import javax.tools.ToolProvider;
@@ -253,9 +255,10 @@ public static void main(String[] args) throws IOException {
253255
}
254256

255257
if (target.equals("SVCOMP")) {
256-
Files.walk(Paths.get(dest))
257-
.filter(path -> path.toString().endsWith(".java"))
258-
.forEach(Main::restructureForSVCompFormat);
258+
List<Path> javaFiles = Files.walk(Paths.get(dest))
259+
.filter(path -> path.toString().endsWith(".java"))
260+
.collect(Collectors.toList());
261+
javaFiles.forEach(Main::restructureForSVCompFormat);
259262
}
260263

261264
removeEmptyDirs(destDir);

0 commit comments

Comments
 (0)
Please sign in to comment.