public class AbstractFindTouchPointsClassInstrumenter extends org.objectweb.asm.ClassVisitor
ClassAdapter
that provides features used by all three passes of instrumentation.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> |
duplicatedLinesMap
This is a map of found duplicates of line blocks.
|
protected java.util.concurrent.atomic.AtomicInteger |
eventIdGenerator
We assign 'unique event identifiers' to every asm instruction or directive found in the file.
|
private java.util.Collection<java.util.regex.Pattern> |
ignoreRegexp
List of patterns to know that we don't want trace lines that are calls to some methods
|
protected java.util.concurrent.atomic.AtomicInteger |
lineIdGenerator
We need to assign a unique lineId to every found 'LINENUMBER' directive in the asm code.
|
Constructor and Description |
---|
AbstractFindTouchPointsClassInstrumenter(org.objectweb.asm.ClassVisitor cv,
java.util.Collection<java.util.regex.Pattern> ignoreRegexp,
java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> duplicatedLinesMap) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<java.util.regex.Pattern> |
getIgnoreRegexp()
Gets list of patterns to know that we don't want trace lines that are calls to some methods
|
void |
setIgnoreRegexp(java.util.Collection<java.util.regex.Pattern> ignoreRegexp)
Sets list of pattern to know that we don't want trace lines that are calls to some methods
|
private java.util.Collection<java.util.regex.Pattern> ignoreRegexp
protected java.util.concurrent.atomic.AtomicInteger eventIdGenerator
AtomicInteger.incrementAndGet()
(not AtomicInteger.getAndIncrement()
!!!)protected final java.util.concurrent.atomic.AtomicInteger lineIdGenerator
Remember that there can exist such a scenario:
LINENUMBER 15 L1 //assigned lineId=33 ... LINENUMBER 16 L2 //assigned lineId=34 ... LINENUMBER 15 L3 //assigned lineId=35This is a reason, why we are going to use this lineIds instead of just 'line number'
We will use this 'generator' to provide this identifiers. Remember to acquire identifiers using AtomicInteger.incrementAndGet()
(not AtomicInteger.getAndIncrement()
!!!)
The lineIdGenerator
that generates the same identifiers is used by: DetectDuplicatedCodeClassVisitor.lineIdGenerator
protected final java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> duplicatedLinesMap
This is a map of found duplicates of line blocks. It's (lineNumber -> (duplicate LineId -> orygin lineId))
The duplicatedLinesMap can be created by a single pass of DetectDuplicatedCodeClassVisitor
(read there for reasons of duplicated detection).
The duplicatedLinesMap
is used to generate the same events Id for events that occurs in ASM code as distinc instructions, but are reason of compilation of the same source-code (finally blocks problem).
public AbstractFindTouchPointsClassInstrumenter(org.objectweb.asm.ClassVisitor cv, java.util.Collection<java.util.regex.Pattern> ignoreRegexp, java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.lang.Integer>> duplicatedLinesMap)
cv
- - a listener for code-instrumentation eventsignoreRegexp
- - list of patters of method calls that should be ignored from line-coverage-measurementduplicatedLinesMap
- - map of found duplicates in the class. You should use DetectDuplicatedCodeClassVisitor
to find the duplicated lines.public java.util.Collection<java.util.regex.Pattern> getIgnoreRegexp()
public void setIgnoreRegexp(java.util.Collection<java.util.regex.Pattern> ignoreRegexp)