Skip to content

Commit 28ac27a

Browse files
author
Steve Salas
committed
Squashed 'bytefrog/' changes from 989f4ca3..7a297ae1
7a297ae1 Merge commit '532e862a67eb52baeee262211658a7614eb70302' 4cbc15a3 Roll back unnecessary bytefrog changes e01a6892 Counts source locations for JSP files c270b15f Deletes unused Code Pulse protocol code b941d452 Adds source location to Code Pulse protocol 4eaa9fd1 Add logging to other modules and revise printlns to be logging statements git-subtree-dir: bytefrog git-subtree-split: 7a297ae1a66cefc8cd9aea895b0544603a387964
1 parent 532e862 commit 28ac27a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

instrumentation/src/main/java/com/codedx/bytefrog/instrumentation/id/ClassIdentifier.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.codedx.bytefrog.instrumentation.id;
2020

21+
import java.util.BitSet;
2122
import java.util.concurrent.ConcurrentHashMap;
2223
import java.util.concurrent.atomic.AtomicInteger;
2324

@@ -31,9 +32,9 @@ public class ClassIdentifier {
3132
private final AtomicInteger nextId = new AtomicInteger();
3233
protected final ConcurrentHashMap<Integer, ClassInformation> map = new ConcurrentHashMap<>();
3334

34-
public int record(String className, String sourceFile, LineLevelMapper lineLevelMapper) {
35+
public int record(String className, String sourceFile, LineLevelMapper lineLevelMapper, BitSet lineNumbers) {
3536
int id = nextId.getAndIncrement();
36-
map.put(id, new ClassInformation(className, sourceFile, lineLevelMapper));
37+
map.put(id, new ClassInformation(className, sourceFile, lineLevelMapper, lineNumbers));
3738
return id;
3839
}
3940

@@ -46,11 +47,13 @@ public static class ClassInformation {
4647
private final String name;
4748
private final String sourceFile;
4849
private final LineLevelMapper lineLevelMapper;
50+
private final BitSet lineNumbers;
4951

50-
public ClassInformation(String name, String sourceFile, LineLevelMapper lineLevelMapper) {
52+
public ClassInformation(String name, String sourceFile, LineLevelMapper lineLevelMapper, BitSet lineNumbers) {
5153
this.name = name;
5254
this.sourceFile = sourceFile;
5355
this.lineLevelMapper = lineLevelMapper;
56+
this.lineNumbers = lineNumbers;
5457
}
5558

5659
/** Gets the name of the class.
@@ -73,5 +76,12 @@ public String getSourceFile() {
7376
public LineLevelMapper getLineLevelMapper() {
7477
return lineLevelMapper;
7578
}
79+
80+
/** Gets the line numbers for the class.
81+
* @returns the line numbers, or null if line numbers are unavailable for class
82+
*/
83+
public BitSet getLineNumbers() {
84+
return lineNumbers;
85+
}
7686
}
7787
}

0 commit comments

Comments
 (0)