1
0
java-21-openjdk/reproducible-properties.patch

12 lines
565 B
Diff
Raw Permalink Normal View History

--- a/src/java.base/share/classes/java/util/Properties.java
+++ b/src/java.base/share/classes/java/util/Properties.java
@@ -955,7 +955,7 @@ public class Properties extends Hashtable<Object,Object> {
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();
}
}