Summary
Retire the system properties sun.io.useCanonCaches and sun.io.useCanonPrefixCache and the underlying internal java.io.ExpiringCache class.
Problem
java.io.File has a cache of canonical paths and part paths to help the performance of the File::getCanonicalFile and File::File::getCanonicalPath. The cache was introduced in JDK 1.4.x to help the startup of Applets and Java Web Start applications running with a security manager. These types of applications are not relevant to JDK 9 or newer releases. Furthermore, java.io.FilePermission was changed in JDK 9 to no longer need the canonical path so this removes must of the original motivation for the cache for the few remaining applications that run with a security manager.
The cache has correctness issues that arise when files are changed or when symbolic files are added to removed. The cache was disabled in JDK 12. It is time to finally remove it.
Solution
Drop the cache and the following two system properties:
sun.io.useCanonCachessun.io.useCanonPrefixCache
Specification
No specification changes, the system properties (and the caching mechanism) were never documented in an implNote.
A release note will be added.
- csr of
-
JDK-8300977 Retire java.io.ExpiringCache
-
- Resolved
-