Skip to content

Commit

Permalink
Fix java-decompiler#250 : "Search function not working correctly" sin…
Browse files Browse the repository at this point in the history
…ce 1.6.0
  • Loading branch information
emmanue1 committed Jun 30, 2019
1 parent 64b17c6 commit cf9262f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,17 @@ protected void match(Indexes indexes, String indexName, String pattern,
if (matchedEntries == null) {
Map<String, Collection> index = indexes.getIndex(indexName);

if (patternLength == 1) {
matchedEntries = matchWithCharFunction.apply(pattern.charAt(0), index);
} else {
String lastKey = key.substring(0, key.length() - 1);
Map<String, Collection> lastMatchedTypes = cache.get(lastKey);
if (lastMatchedTypes != null) {
matchedEntries = matchWithStringFunction.apply(pattern, lastMatchedTypes);
if (index != null) {
if (patternLength == 1) {
matchedEntries = matchWithCharFunction.apply(pattern.charAt(0), index);
} else {
matchedEntries = matchWithStringFunction.apply(pattern, index);
String lastKey = key.substring(0, key.length() - 1);
Map<String, Collection> lastMatchedTypes = cache.get(lastKey);
if (lastMatchedTypes != null) {
matchedEntries = matchWithStringFunction.apply(pattern, lastMatchedTypes);
} else {
matchedEntries = matchWithStringFunction.apply(pattern, index);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ public SearchInConstantPoolsView(
if (selectedTreeNode != null) {
selectedTypeCallback.accept(selectedTreeNode.getUri(), searchInConstantPoolsEnterTextField.getText(), getFlags());
}
searchInConstantPoolsDialog.setVisible(false);
}
};
searchInConstantPoolsOpenButton.addActionListener(searchInConstantPoolsOpenActionListener);
Expand Down

0 comments on commit cf9262f

Please sign in to comment.