RFR: 8022854 : (s) Cleaner re-initialization of System properties

Alan Bateman Alan.Bateman at oracle.com
Tue Jan 28 15:27:13 UTC 2014


On 27/01/2014 20:17, Mike Duigou wrote:
> Hello all;
>
> This is a bit of cleanup I did back during Java 8 that got deferred due to it's late arrival during the development cycle. I've updated it for Java 9.
>
> http://cr.openjdk.java.net/~mduigou/JDK-8022854/0/webrev/
>
> This change improves the implementation of System.setProperties(null) which restores the system properties to their boot time defaults. The existing semantics are preserved.
>
> Mike
I agree with Paul on the naming, getSanitizedSavedProperties is a bit 
odd (but not a big deal as it's internal).

On the wording then "reloaded" is better than "is forgotten" but I 
wonder if it could be a bit clearer, like "reset to the default system 
properties".

On the test then I remember Erik's late change to fix a build issue [1]. 
He added a simple test as part of that and maybe we should remove that 
one now and maybe beef up your test to check the properties listed 
System.getProperties's table are present. A minor comment is that the 
date in the header suggests you wrote this test in 2013. Also just to 
keep things consistent then you might want a space in "if(".

-Alan.

[1] http://hg.openjdk.java.net/jdk8/tl/jdk/rev/2437ccbf3504



More information about the core-libs-dev mailing list