-
Sub-task
-
Resolution: Delivered
-
P4
-
18
-
Verified
A new system property, `java.properties.date`, has been introduced to allow applications to control the default date comment written out by the `java.util.Properties::store` methods. This system property is expected to be set while launching `java`. Any non-empty value of this system property results in that value being used as a comment instead of the default date comment. In the absence of this system property or when the value is empty, the `Properties::store` methods continue to write the default date comment.
An additional change has also been made in the implementation of the `Properties::store` methods to write out the key/value property pairs in a deterministic order. The implementation of these methods now uses the natural sort order of the property keys while writing them out. However, the implementation of these methods continues to use the iteration order when any sub-class of `java.util.Properties` overrides the `entrySet()` method to return a different `Set` than that returned by `super.entrySet()`.
The combination of the deterministic ordering of the properties that get written out with the new system property is particularly useful in environments where applications require the contents of the stored properties to be reproducible. In such cases, applications are expected to provide a fixed value of their choice to this system property.
An additional change has also been made in the implementation of the `Properties::store` methods to write out the key/value property pairs in a deterministic order. The implementation of these methods now uses the natural sort order of the property keys while writing them out. However, the implementation of these methods continues to use the iteration order when any sub-class of `java.util.Properties` overrides the `entrySet()` method to return a different `Set` than that returned by `super.entrySet()`.
The combination of the deterministic ordering of the properties that get written out with the new system property is particularly useful in environments where applications require the contents of the stored properties to be reproducible. In such cases, applications are expected to provide a fixed value of their choice to this system property.