@@ -66,7 +66,7 @@ protected LineTagMap() {
66
66
this .sym_tags = new HashMap <>();
67
67
}
68
68
}
69
- // line -> tag_map
69
+ // line number -> tag map
70
70
private final Map <Integer , LineTagMap > line_maps ;
71
71
72
72
/**
@@ -128,9 +128,9 @@ public boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) {
128
128
129
129
// Get tag info
130
130
if (lines != null && lines .contains (lineNumber )) {
131
- LineTagMap line_map = line_maps .get (lineNumber );
132
- if (line_map != null ) {
133
- for (Tag tag : line_map .sym_tags .get (symbol )) {
131
+ LineTagMap lineMap = line_maps .get (lineNumber );
132
+ if (lineMap != null ) {
133
+ for (Tag tag : lineMap .sym_tags .get (symbol )) {
134
134
if (tag .used ) {
135
135
continue ;
136
136
}
@@ -183,15 +183,13 @@ public List<Tag> getTags() {
183
183
* @return list of tags
184
184
*/
185
185
public List <Tag > getTags (int line ) {
186
- LineTagMap line_map = line_maps .get (line );
186
+ LineTagMap lineMap = line_maps .get (line );
187
187
List <Tag > result = null ;
188
188
189
- if (line_map != null ) {
189
+ if (lineMap != null ) {
190
190
result = new ArrayList <>();
191
- for (Set <Tag > ltags : line_map .sym_tags .values ()) {
192
- for (Tag tag : ltags ) {
193
- result .add (tag );
194
- }
191
+ for (Set <Tag > ltags : lineMap .sym_tags .values ()) {
192
+ result .addAll (ltags );
195
193
}
196
194
}
197
195
@@ -243,7 +241,7 @@ public static class Tag implements Serializable {
243
241
/**
244
242
* A non-serialized marker for marking a tag to avoid its reuse.
245
243
*/
246
- public transient boolean used ;
244
+ private transient boolean used ;
247
245
248
246
protected Tag (int line , String symbol , String type , String text ,
249
247
String namespace , String signature , int lineStart ,
@@ -266,9 +264,9 @@ public void addTag(int line, String symbol, String type, String text,
266
264
267
265
public void addTag (int line , String symbol , String type , String text ,
268
266
String namespace , String signature , int lineStart , int lineEnd ) {
269
- Tag new_tag = new Tag (line , symbol , type , text , namespace , signature ,
267
+ Tag newTag = new Tag (line , symbol , type , text , namespace , signature ,
270
268
lineStart , lineEnd );
271
- tags .add (new_tag );
269
+ tags .add (newTag );
272
270
Set <Integer > lines = symbols .get (symbol );
273
271
if (lines == null ) {
274
272
lines = new HashSet <>();
@@ -278,19 +276,19 @@ public void addTag(int line, String symbol, String type, String text,
278
276
lines .add (aLine );
279
277
280
278
// Get per line map
281
- LineTagMap line_map = line_maps .get (aLine );
282
- if (line_map == null ) {
283
- line_map = new LineTagMap ();
284
- line_maps .put (aLine , line_map );
279
+ LineTagMap lineMap = line_maps .get (aLine );
280
+ if (lineMap == null ) {
281
+ lineMap = new LineTagMap ();
282
+ line_maps .put (aLine , lineMap );
285
283
}
286
284
287
285
// Insert sym->tag map for this line
288
- Set <Tag > ltags = line_map .sym_tags .get (symbol );
286
+ Set <Tag > ltags = lineMap .sym_tags .get (symbol );
289
287
if (ltags == null ) {
290
288
ltags = new HashSet <>();
291
- line_map .sym_tags .put (symbol , ltags );
289
+ lineMap .sym_tags .put (symbol , ltags );
292
290
}
293
- ltags .add (new_tag );
291
+ ltags .add (newTag );
294
292
}
295
293
296
294
/**
0 commit comments