Skip to content

Commit 72c2a6f

Browse files
committed
TS-45056 Comments with more details on the "why"
1 parent f23deb6 commit 72c2a6f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

report-generator/src/main/kotlin/com/teamscale/report/jacoco/JaCoCoBasedReportGenerator.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ import java.io.OutputStream
1717
/**
1818
* Base class for generating reports based on the binary JaCoCo exec dump files.
1919
*
20-
* It takes care of ignoring non-identical classes with the same fully qualified name and classes without coverage.
20+
* JaCoCo's execution data only contains per-class boolean arrays indicating which probes fired. It does not contain
21+
* any structural information (method names, line numbers, branch locations). The class files in
22+
* [codeDirectoriesOrArchives] provide that structural information: JaCoCo re-analyzes them to reconstruct which probes
23+
* correspond to which lines and branches, then merges this with the execution data to produce a meaningful coverage
24+
* report.
25+
*
26+
* Since the same class can appear in multiple archives (for example, a dependency bundled in two WARs), this class
27+
* detects such duplicates via [EnhancedCoverageVisitor] and handles them according to [duplicateClassFileBehavior].
2128
*
2229
* @param codeDirectoriesOrArchives Directories and zip files that contain class files.
2330
* @param locationIncludeFilter Include filter to apply to all locations during class file traversal.

0 commit comments

Comments
 (0)