--- old/src/java.base/share/classes/jdk/internal/jrtfs/JrtDirectoryStream.java 2015-11-11 21:05:55.910122100 +0530 +++ new/src/java.base/share/classes/jdk/internal/jrtfs/JrtDirectoryStream.java 2015-11-11 21:05:55.363090900 +0530 @@ -39,10 +39,7 @@ final class JrtDirectoryStream implements DirectoryStream { private final AbstractJrtFileSystem jrtfs; - private final byte[] path; - // prefix to be used for children of this directory - // so that child path are reported relatively (if needed) - private final String childPrefix; + private final AbstractJrtPath dir; private final DirectoryStream.Filter filter; private volatile boolean isClosed; private volatile Iterator itr; @@ -51,22 +48,12 @@ DirectoryStream.Filter filter) throws IOException { this.jrtfs = jrtPath.getFileSystem(); - this.path = jrtPath.getResolvedPath(); + this.dir = jrtPath; // sanity check - if (!jrtfs.isDirectory(path, true)) { + if (!jrtfs.isDirectory(dir, true)) { throw new NotDirectoryException(jrtPath.toString()); } - // absolute path and does not have funky chars in front like /./java.base - if (jrtPath.isAbsolute() && (path.length == jrtPath.getPathLength())) { - childPrefix = null; - } else { - // cases where directory content needs to modified with prefix - // like ./java.base, /./java.base, java.base and so on. - String dirName = jrtPath.toString(); - int idx = dirName.indexOf(JrtFileSystem.getString(path).substring(1)); - childPrefix = dirName.substring(0, idx); - } this.filter = filter; } @@ -80,7 +67,7 @@ } try { - itr = jrtfs.iteratorOf(path, childPrefix); + itr = jrtfs.iteratorOf(dir); } catch (IOException e) { throw new IllegalStateException(e); }