Search in sources :

Example 1 with ClassAnalyzer

use of org.jacoco.core.internal.analysis.ClassAnalyzer in project jacoco by jacoco.

the class Analyzer method createAnalyzingVisitor.

/**
 * Creates an ASM class visitor for analysis.
 *
 * @param classid
 *            id of the class calculated with {@link CRC64}
 * @param className
 *            VM name of the class
 * @return ASM visitor to write class definition to
 */
private ClassVisitor createAnalyzingVisitor(final long classid, final String className) {
    final ExecutionData data = executionData.get(classid);
    final boolean[] probes;
    final boolean noMatch;
    if (data == null) {
        probes = null;
        noMatch = executionData.contains(className);
    } else {
        probes = data.getProbes();
        noMatch = false;
    }
    final ClassCoverageImpl coverage = new ClassCoverageImpl(className, classid, noMatch);
    final ClassAnalyzer analyzer = new ClassAnalyzer(coverage, probes, stringPool) {

        @Override
        public void visitEnd() {
            super.visitEnd();
            coverageVisitor.visitCoverage(coverage);
        }
    };
    return new ClassProbesAdapter(analyzer, false);
}
Also used : ClassAnalyzer(org.jacoco.core.internal.analysis.ClassAnalyzer) ClassCoverageImpl(org.jacoco.core.internal.analysis.ClassCoverageImpl) ClassProbesAdapter(org.jacoco.core.internal.flow.ClassProbesAdapter) ExecutionData(org.jacoco.core.data.ExecutionData)

Aggregations

ExecutionData (org.jacoco.core.data.ExecutionData)1 ClassAnalyzer (org.jacoco.core.internal.analysis.ClassAnalyzer)1 ClassCoverageImpl (org.jacoco.core.internal.analysis.ClassCoverageImpl)1 ClassProbesAdapter (org.jacoco.core.internal.flow.ClassProbesAdapter)1