Skip to content

Commit 465b39b

Browse files
ginoaugustinevladak
authored andcommitted
closes #4491
Signed-off-by: Gino Augustine <[email protected]>
1 parent 21414eb commit 465b39b

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Definitions.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@ public class Definitions implements Serializable {
6464
public static class LineTagMap implements Serializable {
6565

6666
private static final long serialVersionUID = 1191703801007779481L;
67-
private final Map<String, Set<Tag>> symTags; //NOPMD
67+
@SuppressWarnings("java:S116")
68+
private final Map<String, Set<Tag>> sym_tags; //NOPMD
6869

6970
protected LineTagMap() {
70-
this.symTags = new HashMap<>();
71+
this.sym_tags = new HashMap<>();
7172
}
7273
}
7374
// line number -> tag map
74-
private final Map<Integer, LineTagMap> lineMaps;
75+
@SuppressWarnings("java:S116")
76+
private final Map<Integer, LineTagMap> line_maps;
7577

7678
/**
7779
* Map from symbol to the line numbers on which the symbol is defined.
@@ -84,7 +86,7 @@ protected LineTagMap() {
8486

8587
public Definitions() {
8688
symbols = new HashMap<>();
87-
lineMaps = new HashMap<>();
89+
line_maps = new HashMap<>();
8890
tags = new ArrayList<>();
8991
}
9092

@@ -134,9 +136,9 @@ public boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) {
134136
.filter(lines -> lines.contains(lineNumber))
135137
.isPresent();
136138
if (isDefinitionPresent) {
137-
LineTagMap lineMap = lineMaps.get(lineNumber);
139+
LineTagMap lineMap = line_maps.get(lineNumber);
138140
if (lineMap != null) {
139-
for (Tag tag : lineMap.symTags.get(symbol)) {
141+
for (Tag tag : lineMap.sym_tags.get(symbol)) {
140142
if (tag.used) {
141143
continue;
142144
}
@@ -189,8 +191,8 @@ public List<Tag> getTags() {
189191
* @return list of tags or null
190192
*/
191193
public @Nullable List<Tag> getTags(int line) {
192-
return Optional.ofNullable(lineMaps.get(line))
193-
.map(lineMap -> lineMap.symTags.values().stream()
194+
return Optional.ofNullable(line_maps.get(line))
195+
.map(lineMap -> lineMap.sym_tags.values().stream()
194196
.flatMap(Collection::stream)
195197
.collect(Collectors.toList())
196198
)
@@ -274,14 +276,14 @@ public void addTag(int line, String symbol, String type, String text,
274276
lines.add(aLine);
275277

276278
// Get per line map
277-
LineTagMap lineMap = lineMaps.computeIfAbsent(aLine,
279+
LineTagMap lineMap = line_maps.computeIfAbsent(aLine,
278280
key -> new LineTagMap());
279281

280282
// Insert sym->tag map for this line
281-
Set<Tag> ltags = lineMap.symTags.get(symbol);
283+
Set<Tag> ltags = lineMap.sym_tags.get(symbol);
282284
if (ltags == null) {
283285
ltags = new HashSet<>();
284-
lineMap.symTags.put(symbol, ltags);
286+
lineMap.sym_tags.put(symbol, ltags);
285287
}
286288
ltags.add(newTag);
287289
}

0 commit comments

Comments
 (0)