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

jrt file system's DirectoryStream reports child paths with wrong paths for directories under /packages

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9-repo-jigsaw
    • 9, 9-repo-jigsaw
    • core-libs
    • None

      http://mail.openjdk.java.net/pipermail/jigsaw-dev/2015-November/005102.html

      Email content reproduced here:

      -------------- email starts here ------------------
      Hi

      I have encountered something with I believe may be a bug in the jrt
      filesystem.

      The children/directory entries of
      /packages/com.oracle/java.xml.ws/com are
      /modules/java.xml.ws/com/sun
      /modules/java.xml.ws/com/oracle
      when I believe they should be:
      /packages/com.oracle/java.xml.ws/com/sun
      /packages/com.oracle/java.xml.ws/com/oracle

      You can use the following code to reproduce the issue:

      FileSystem fileSystem = FileSystems.getFileSystem(URI.create("jrt:/"));
      Path parent = fileSystem.getPath("/packages/com.oracle/java.xml.ws/com");
      try (DirectoryStream<Path> directoryStream =
      Files.newDirectoryStream(parent)) {
         for (Path each : directoryStream) {
           System.out.println(" parent: " + parent + " child: " + each + "
      startsWith: " + each.startsWith(parent));
         }
      }

      The output I get is:

        parent: /packages/com.oracle/java.xml.ws/com child:
      /modules/java.xml.ws/com/oracle startsWith: false

        parent: /packages/com.oracle/java.xml.ws/com child:
      /modules/java.xml.ws/com/sun startsWith: false

      This is based on b86 with Jigsaw on Mac OS.

      Cheers
      Philippe

      ---------- email ends here -------------

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: