Skip to content

Commit

Permalink
fix(gui): don't skip indexing code lines starting with '}' (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Jan 10, 2019
1 parent ddaf037 commit 1272ae2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions jadx-gui/src/main/java/jadx/gui/utils/search/TextSearchIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,17 @@ public void indexCode(JavaClass cls, CodeLinesInfo linesInfo, List<StringRef> li
int count = lines.size();
for (int i = 0; i < count; i++) {
StringRef line = lines.get(i);
if (line.length() != 0 && line.charAt(0) != '}') {
int lineNum = i + 1;
JavaNode node = linesInfo.getJavaNodeByLine(lineNum);
CodeNode codeNode = new CodeNode(nodeCache.makeFrom(node == null ? cls : node), lineNum, line);
if (strRefSupported) {
codeIndex.put(line, codeNode);
} else {
codeIndex.put(line.toString(), codeNode);
}
int lineLength = line.length();
if (lineLength == 0 || (lineLength == 1 && line.charAt(0) == '}')) {
continue;
}
int lineNum = i + 1;
JavaNode node = linesInfo.getJavaNodeByLine(lineNum);
CodeNode codeNode = new CodeNode(nodeCache.makeFrom(node == null ? cls : node), lineNum, line);
if (strRefSupported) {
codeIndex.put(line, codeNode);
} else {
codeIndex.put(line.toString(), codeNode);
}
}
} catch (Exception e) {
Expand Down

0 comments on commit 1272ae2

Please sign in to comment.