Skip to content

Commit cf9262f

Browse files
author
emmanue1
committed
Fix #250 : "Search function not working correctly" since 1.6.0
1 parent 64b17c6 commit cf9262f

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

app/src/main/java/org/jd/gui/controller/SearchInConstantPoolsController.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,17 @@ protected void match(Indexes indexes, String indexName, String pattern,
291291
if (matchedEntries == null) {
292292
Map<String, Collection> index = indexes.getIndex(indexName);
293293

294-
if (patternLength == 1) {
295-
matchedEntries = matchWithCharFunction.apply(pattern.charAt(0), index);
296-
} else {
297-
String lastKey = key.substring(0, key.length() - 1);
298-
Map<String, Collection> lastMatchedTypes = cache.get(lastKey);
299-
if (lastMatchedTypes != null) {
300-
matchedEntries = matchWithStringFunction.apply(pattern, lastMatchedTypes);
294+
if (index != null) {
295+
if (patternLength == 1) {
296+
matchedEntries = matchWithCharFunction.apply(pattern.charAt(0), index);
301297
} else {
302-
matchedEntries = matchWithStringFunction.apply(pattern, index);
298+
String lastKey = key.substring(0, key.length() - 1);
299+
Map<String, Collection> lastMatchedTypes = cache.get(lastKey);
300+
if (lastMatchedTypes != null) {
301+
matchedEntries = matchWithStringFunction.apply(pattern, lastMatchedTypes);
302+
} else {
303+
matchedEntries = matchWithStringFunction.apply(pattern, index);
304+
}
303305
}
304306
}
305307

app/src/main/java/org/jd/gui/view/SearchInConstantPoolsView.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ public SearchInConstantPoolsView(
250250
if (selectedTreeNode != null) {
251251
selectedTypeCallback.accept(selectedTreeNode.getUri(), searchInConstantPoolsEnterTextField.getText(), getFlags());
252252
}
253-
searchInConstantPoolsDialog.setVisible(false);
254253
}
255254
};
256255
searchInConstantPoolsOpenButton.addActionListener(searchInConstantPoolsOpenActionListener);

0 commit comments

Comments
 (0)