RFR 8198997: Cache normalized/resolved user.dir property

Alan Bateman Alan.Bateman at oracle.com
Tue Mar 13 19:24:07 UTC 2018


On 12/03/2018 18:32, Brian Burkhalter wrote:
> https://bugs.openjdk.java.net/browse/JDK-8198997
> http://cr.openjdk.java.net/~bpb/8198997/webrev.00/
>
> Lazily cache the value of the user.dir property on first access. This change is for Windows only as there does not appear to be any percentage in doing something similar on Unix.
>
The user.dir property comes from GetCurrentDirectoryW so it will be 
normalized anyway. Although unsupported, I guess there may be some 
deployments setting this property on the command line so it is safer to 
normalize. As relative paths are command then it might be simpler to 
just change the static initializer to initialize userDir to 
normalize(props.getProperty("user.dir")).

-Alan


More information about the core-libs-dev mailing list