RFR: 8231640: (prop) Canonical property storage [v13]

Daniel Fuchs dfuchs at openjdk.java.net
Tue Sep 14 13:01:10 UTC 2021

On Tue, 14 Sep 2021 11:59:56 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/Properties.java line 836:
>>> 834:      * <p>
>>> 835:      * Then every entry in this {@code Properties} table is
>>> 836:      * written out, one per line. For each entry the key string is
>> Sorry for coming late to the party: I don't remember if this was already asked for and rejected - but shouldn't there be a non-normative `@implNote` here to state that the default implementation of this method will write the properties sorted by their keys in alphanumeric ordering?
>> Otherwise this looks very good!
> Hello Daniel, you are right - I missed discussing whether or not to include a `@implNote` to explain the natural sorted order of the property keys. When we started this whole PR proposal, Alan had hinted that maybe we should "specify" this behaviour. Should this be a `@implNote` or should this be part of the formal spec like we did for the system property handling?

I would leave it as an `@implNote` - or possibly `@implSpec`: depending on whether or not we want all implementations of the spec to behave in this way. However I don't think we would want to prevent subclasses from overriding this behavior and using their own business-logic ordering. So I believe the default behavior should be specified, if only so that subclasses can decide whether or not to override this method, without invalidating what subclasses might currently have implemented - or might wish to implement in the future. The CSR will be a good way to get feedback on whether `@implNote` or `@implSpec` is more appropriate. Also this is a change in behavior that needs to be made visible somewhere - and nobody reads release notes ;-)


PR: https://git.openjdk.java.net/jdk/pull/5372

More information about the core-libs-dev mailing list