diff --git a/cli/src/main/java/net/neoforged/jst/cli/SourceFileProcessor.java b/cli/src/main/java/net/neoforged/jst/cli/SourceFileProcessor.java index e4cbbc6..ee8d1ad 100644 --- a/cli/src/main/java/net/neoforged/jst/cli/SourceFileProcessor.java +++ b/cli/src/main/java/net/neoforged/jst/cli/SourceFileProcessor.java @@ -45,7 +45,7 @@ public void process(FileSource source, FileSink sink, List tr transformer.beforeRun(context); } - if (sink.isOrdered()) { + if (source.isOrdered() && sink.isOrdered()) { try (var stream = source.streamEntries()) { stream.forEach(entry -> { try { @@ -82,7 +82,8 @@ private void processEntry(FileEntry entry, VirtualFile sourceRoot, List streamEntries() { - return zipFile.stream().map(ze -> FileEntries.ofZipEntry(zipFile, ze)); + var spliterator = Spliterators.spliterator( + zipFile.entries().asIterator(), + zipFile.size(), + Spliterator.IMMUTABLE | Spliterator.ORDERED + ); + return StreamSupport.stream(spliterator, false) + .map(ze -> FileEntries.ofZipEntry(zipFile, ze)); } @Override diff --git a/tests/src/test/java/net/neoforged/jst/tests/EmbeddedTest.java b/tests/src/test/java/net/neoforged/jst/tests/EmbeddedTest.java index 3c2250f..9715e88 100644 --- a/tests/src/test/java/net/neoforged/jst/tests/EmbeddedTest.java +++ b/tests/src/test/java/net/neoforged/jst/tests/EmbeddedTest.java @@ -228,6 +228,7 @@ protected final void runTest(String testDirName, String mappingsFilename) throws Files.write(librariesFile, List.of("-e=" + junitJarPath)); runTool( + "--max-queue-depth=1", "--libraries-list", librariesFile.toString(), "--enable-parchment",