use of org.jacoco.core.internal.analysis.SourceFileCoverageImpl in project jacoco by jacoco.
the class CoverageBuilder method visitCoverage.
// === IStructureVisitor ===
public void visitCoverage(final IClassCoverage coverage) {
// Only consider classes that actually contain code:
if (coverage.getInstructionCounter().getTotalCount() > 0) {
final String name = coverage.getName();
final IClassCoverage dup = classes.put(name, coverage);
if (dup != null) {
if (dup.getId() != coverage.getId()) {
throw new IllegalStateException("Can't add different class with same name: " + name);
}
} else {
final String source = coverage.getSourceFileName();
if (source != null) {
final SourceFileCoverageImpl sourceFile = getSourceFile(source, coverage.getPackageName());
sourceFile.increment(coverage);
}
}
}
}
Aggregations