Skip to content

Commit

Permalink
Fixes java-decompiler#29, "search cannot display/open files" with an …
Browse files Browse the repository at this point in the history
…unpackaged project
  • Loading branch information
emmanue1 committed May 29, 2015
1 parent 97c9107 commit fc6de07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class SearchInConstantPoolsController implements IndexesChangeListener {
Container.Entry getParent() { null }
URI getUri() { parentEntry.uri }
String getPath() { parentEntry.path }
boolean isDirectory() { false }
boolean isDirectory() { parentEntry.isDirectory() }
long length() { 0 }
InputStream getInputStream() { null }
Collection<Container.Entry> getChildren() { children }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ class GenericContainer implements Container {
GenericContainer(API api, Container.Entry parentEntry, Path rootPath) {
this.api = api
this.rootNameCount = rootPath.nameCount
this.root = newEntry(parentEntry, rootPath, parentEntry.uri)
}

protected Container.Entry newEntry(Container.Entry parent, Path fsPath, URI uri) {
return new Entry(parent, fsPath, uri)
this.root = new Entry(parentEntry, rootPath, parentEntry.uri) {
Entry newChildEntry(Path fsPath) { new Entry(parent, fsPath, null) }
}
}

String getType() { 'generic' }
Expand All @@ -47,6 +45,8 @@ class GenericContainer implements Container {
this.children = null
}

Entry newChildEntry(Path fsPath) { new Entry(this, fsPath, null) }

Container getContainer() { GenericContainer.this }
Container.Entry getParent() { parent }

Expand Down Expand Up @@ -103,7 +103,7 @@ class GenericContainer implements Container {

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

Expand Down

0 comments on commit fc6de07

Please sign in to comment.