Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8224946

jrtfs URI to Path and Path to URI conversions are wrong

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b24
    • CPU:
      generic
    • OS:
      generic

      Backports

        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())));

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sundar Sundararajan Athijegannathan
                  Reporter:
                  sundar Sundararajan Athijegannathan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: