Possible jrt filesystem bug

Philippe Marschall philippe.marschall at netcetera.ch
Tue Nov 3 08:25:09 UTC 2015


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

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

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.


More information about the jigsaw-dev mailing list