[minor feature change] java.util.Properties

Alan Bateman Alan.Bateman at oracle.com
Sun Dec 15 19:26:02 UTC 2019


On 15/12/2019 16:37, Bradley Willcott wrote:
> Hi there,
>
> I have been told that this is the correct place is to propose a change 
> to the Java SDK.
>
> I would like to propose the following changes to /java.util.Properties/:
>
> 1) That the current built-in treatment of the space character ' ' as a 
> key/value pair separator, be made optional.  This would allow for keys 
> to have un-escaped space characters in them, as is often the case in 
> Windows '.ini' files. I have also found a few linux '.conf' files with 
> them as well!
>
> 2) That the output of the commented Date be made optional.
>
> I already have a working modified copy of the class in my own class 
> library.  However, this can only be a short term solution as it will 
> become a problem once the JDK version is changed.
>
> Thoughts and helpful suggestions please.
There has been recent discussion about storing properties in a canonical 
form to allow for repeatable builds. It's tracked as JDK-8231640 [1] and 
will likely require introducing a new store method. Nobody has stepped 
up to run with that one yet.

For the suggestion to allow spaces in keys then you'll need to research 
the compatibility impact. Properties files have been around since JDK 
1.0 so changing the spec after all this time would require a lot of 
care, esp.  interop across JDK releases and cases where a property is 
defined over more than one "natural line".

-Alan

[1] https://bugs.openjdk.java.net/browse/JDK-8231640




More information about the core-libs-dev mailing list