Fix #250 : "Search function not working correctly" since 1.6.0

This commit is contained in:
emmanue1 2019-06-30 09:09:11 +02:00
parent 64b17c6a18
commit cf9262f3d6
2 changed files with 10 additions and 9 deletions

View File

@ -291,15 +291,17 @@ public class SearchInConstantPoolsController implements IndexesChangeListener {
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);
}
}
}

View File

@ -250,7 +250,6 @@ public class SearchInConstantPoolsView<T extends DefaultMutableTreeNode & Contai
if (selectedTreeNode != null) {
selectedTypeCallback.accept(selectedTreeNode.getUri(), searchInConstantPoolsEnterTextField.getText(), getFlags());
}
searchInConstantPoolsDialog.setVisible(false);
}
};
searchInConstantPoolsOpenButton.addActionListener(searchInConstantPoolsOpenActionListener);