use of org.objectweb.asm.commons.AnalyzerAdapter in project jacoco by jacoco.
the class ClassProbesAdapter method visitMethod.
@Override
public final MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
final MethodProbesVisitor methodProbes;
final MethodProbesVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions);
if (mv == null) {
// We need to visit the method in any case, otherwise probe ids
// are not reproducible
methodProbes = EMPTY_METHOD_PROBES_VISITOR;
} else {
methodProbes = mv;
}
return new MethodSanitizer(null, access, name, desc, signature, exceptions) {
@Override
public void visitEnd() {
super.visitEnd();
LabelFlowAnalyzer.markLabels(this);
final MethodProbesAdapter probesAdapter = new MethodProbesAdapter(methodProbes, ClassProbesAdapter.this);
if (trackFrames) {
final AnalyzerAdapter analyzer = new AnalyzerAdapter(ClassProbesAdapter.this.name, access, name, desc, probesAdapter);
probesAdapter.setAnalyzer(analyzer);
methodProbes.accept(this, analyzer);
} else {
methodProbes.accept(this, probesAdapter);
}
}
};
}
use of org.objectweb.asm.commons.AnalyzerAdapter in project jacoco by jacoco.
the class MethodProbesAdapterTest method setup.
@Before
public void setup() {
label = new Label();
id = 1000;
expected = new MethodRecorder();
expectedVisitor = new TraceAdapter(expected);
actual = new MethodRecorder();
MethodProbesVisitor actualVisitor = new TraceAdapter(actual);
MethodProbesAdapter probesAdapter = new MethodProbesAdapter(actualVisitor, this);
final AnalyzerAdapter analyzer = new AnalyzerAdapter("Foo", 0, "doit", "()V", probesAdapter);
probesAdapter.setAnalyzer(analyzer);
adapter = analyzer;
frame = new IFrame() {
public void accept(MethodVisitor mv) {
}
};
}
use of org.objectweb.asm.commons.AnalyzerAdapter in project jacoco by jacoco.
the class FrameSnapshotTest method setup.
@Before
public void setup() {
analyzer = new AnalyzerAdapter("Foo", 0, "doit", "()V", null);
expected = new MethodRecorder();
expectedVisitor = expected.getVisitor();
}
Aggregations