JDK-8224946 : jrtfs URI to Path and Path to URI conversions are wrong
  • Type: Bug
  • Component: tools
  • Sub-Component: jlink
  • Affected Version: 13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2019-05-29
  • Updated: 2019-07-02
  • Resolved: 2019-05-30
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 13 JDK 14
13 b24Fixed 14Fixed
Related Reports
CSR :  
Relates :  
Sub Tasks
JDK-8226948 :  
Description
Consider the following: 

        var uri = URI.create("jrt:/java.base/module-info.class"); 
        var path = Path.of(uri); 
        assertTrue(Files.exists(path)); 

This fails because the file path returned by JrtFIleSystemProvider getPath(URI) is "/java.base/module-info.class", it should be "/modules/java.base/module-info.class". 

If this bug is fixed then the following round trip should also work: 

        // check round-trip 
        var jrtfs = FileSystems.getFileSystem(URI.create("jrt:/")); 
        assertTrue(Files.exists(jrtfs.getPath(path.toString())));