java-23-openjdk/reproducible-properties.patch

12 lines
583 B
Diff

--- a/src/java.base/share/classes/java/util/Properties.java
+++ b/src/java.base/share/classes/java/util/Properties.java
@@ -955,7 +955,7 @@ private static void writeDateComment(BufferedWriter bw) throws IOException {
if (sysPropVal != null && !sysPropVal.isEmpty()) {
writeComments(bw, sysPropVal);
} else {
- bw.write("#" + new Date());
+ bw.write("#" + (System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()));
bw.newLine();
}
}