Hello Robert,

On 07/09/21 11:24 pm, Robert Scholte wrote:
On Sat, 4 Sep 2021 18:30:06 GMT, Andrey Turbanov 
<github.com+741251+turban...@openjdk.org> wrote:

Jaikiran Pai has updated the pull request incrementally with one additional 
commit since the last revision:

   use @implNote to explain the use of the environment variable
src/java.base/share/classes/java/util/Properties.java line 924:

922:         writeDateComment(bw);
923:         synchronized (this) {
924:             for (Map.Entry<Object, Object> e : new 
TreeMap<>(map).entrySet()) {
Is this sorting intentionally added? It's not clear from issue description or 
PR description that order of properties should be changed too.
Anyway I think copying `entrySet()` to array and then sorting should be faster, 
than creating a TreeMap
In case of reproducibility it should be at least ordered, i.e. keep original 
input order.

As discussed in the mailing list, it is agreed upon that these property keys will be oredered when they are written out by the store() APIs. Thus providing reproducibility. However, the order will not be the insertion order, instead it will be the natural order of the property keys and this order will only be applicable/maintained when using the store() APIs. Trying to store them in a original input order will be a much bigger change and won't just be applicable for the store() APIs but the entire internal implementation of the Properties class itself.

-Jaikiran

Reply via email to