Skip to content

Commit

Permalink
Fixes java-decompiler#3, New version 1.0 does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Mar 26, 2015
1 parent 19a6ca8 commit dc165d7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,23 @@ class GenericContainer implements Container {
}

protected Collection<Container.Entry> loadChildrenFromDirectoryEntry() {
return Files.newDirectoryStream(fsPath).collect { Path subPath -> new Entry(this, subPath, null) }.sort()
DirectoryStream<Path> stream = null

try {
def children = new ArrayList<Container.Entry>()
int parentNameCount = fsPath.nameCount
stream = Files.newDirectoryStream(fsPath)

for (def subPath : stream) {
if (subPath.nameCount > parentNameCount) {
children.add(new Entry(this, subPath, null))
}
}

return children.sort()
} finally {
stream?.close()
}
}

protected Collection<Container.Entry> loadChildrenFromFileEntry() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class ClassFileLoaderProvider extends AbstractFileLoaderProvider {
def path = file.path

while (! path.endsWith(pathSuffix)) {
int index = pathSuffix.indexOf(File.separatorChar)
int index = pathSuffix.indexOf(File.separator)

if (index == -1) {
pathSuffix = ''
} else {
pathSuffix = pathSuffix.substring(index)
pathSuffix = pathSuffix.substring(index+1)
}
}

Expand Down

0 comments on commit dc165d7

Please sign in to comment.