Skip to content

Commit be70073

Browse files
committed
Add more aggressive flushing/closing to attempt to address intermittent creation of invalid jars.
1 parent d5993f5 commit be70073

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/de/oceanlabs/mcp/mcinjector/MCInjectorImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ private void processJar(Path inFile, Path outFile) throws IOException
9090
if (entry.isDirectory())
9191
{
9292
outJar.putNextEntry(entry);
93+
outJar.closeEntry();
9394
continue;
9495
}
9596

@@ -129,6 +130,7 @@ private void processJar(Path inFile, Path outFile) throws IOException
129130
newEntry.setTime(0); //Stabilize time.
130131
outJar.putNextEntry(newEntry);
131132
outJar.write(entryData);
133+
outJar.closeEntry();
132134
entries.add(entryName);
133135
}
134136

@@ -144,7 +146,10 @@ private void processJar(Path inFile, Path outFile) throws IOException
144146
outJar.write(abstractParameters.get(key).stream().collect(Collectors.joining(" ")).getBytes(StandardCharsets.UTF_8));
145147
outJar.write('\n');
146148
}
149+
outJar.closeEntry();
147150
}
151+
152+
outJar.flush();
148153
}
149154
}
150155
}

0 commit comments

Comments
 (0)