JDK-8309215 : Release Note: `java.io.File`'s Canonical Path Cache Is Removed
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2023-05-31
  • Updated: 2023-11-15
  • Resolved: 2023-06-04
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 21
21Resolved
Description
`java.io.File` has historically cached canonical paths, and part paths, to help the performance of the `File::getCanonicalFile` and `File::getCanonicalPath` when running with a `SecurityManager` set.  The cache had correctness issues in environments with symbolic links and has been disabled by default since JDK 12.  The cache has been removed in this release, along with the system properties `sun.io.useCanonCaches` and `sun.io.useCanonPrefixCache`. Setting these properties no longer has any effect.