Skip to content

Commit 3690b9c

Browse files
committed
Set output ZipEntry times to 0, to stabelize output jar.
1 parent ae4e715 commit 3690b9c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,17 @@ private void processJar(Path inFile, Path outFile) throws IOException
124124
}
125125

126126
ZipEntry newEntry = new ZipEntry(entryName);
127+
newEntry.setTime(0); //Stabilize time.
127128
outJar.putNextEntry(newEntry);
128129
outJar.write(entryData);
129130
entries.add(entryName);
130131
}
131132

132133
if (!abstractParameters.isEmpty() && !entries.contains("fernflower_abstract_parameter_names.txt"))
133134
{
134-
outJar.putNextEntry(new ZipEntry("fernflower_abstract_parameter_names.txt"));
135+
ZipEntry entry = new ZipEntry("fernflower_abstract_parameter_names.txt");
136+
entry.setTime(0); //Stabilize time.
137+
outJar.putNextEntry(entry);
135138
for (String key : abstractParameters.keySet().stream().sorted().collect(Collectors.toList()))
136139
{
137140
outJar.write(key.getBytes(StandardCharsets.UTF_8));//class method desc

0 commit comments

Comments
 (0)