JDK-8198997 : Cache normalized/resolved user.dir property
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 11
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-03-05
  • Updated: 2018-06-27
  • Resolved: 2018-03-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b07Fixed
Related Reports
Relates :  
Description
The value of user.dir property is cached without without being normalized.
But it must be normalized before it can be used; repeatedly normalization
is inefficient.

8194154 cached the value of user.dir without normalization.
Applies to both WinNTFileSystem and UnixFileSystem.
Comments
On Unix the property is eventually obtained via a call to the native C library function getcwd(3) which would presumably provide a well formed string.
12-03-2018

The resolve(File) method indirectly does something similar but does not call normalize(). Thee may be little benefit on Unix of cleaning up the value from the property since it is most likely well formed from the OS.
05-03-2018

In UnixFileSystem it does not look as if the cached userDir is currently normalized anywhere. In WinNTFileSystem however it could be repeatedly normalized in getUserPath().
05-03-2018