File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
agent/src/main/java/com/teamscale/jacoco/agent Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,8 @@ private static void deleteDirectoryIfEmpty(Path directory) throws IOException {
159159 /**
160160 * Dumps the current execution data, converts it, writes it to the output directory defined in {@link #options} and
161161 * uploads it if an uploader is configured. Logs any errors, never throws an exception.
162+ * <p>
163+ * Synchronized because this can be triggered concurrently by the timer and by the HTTP /dump endpoint.
162164 */
163165 @ Override
164166 public synchronized void dumpReport () {
@@ -182,6 +184,9 @@ private void dumpReportUnsafe() {
182184 return ;
183185 }
184186
187+ // Created fresh per dump so its CoverageBuilder does not carry class IDs from previous dumps.
188+ // Without this, application server reloads (for example, JBoss) cause an IllegalStateException
189+ // because the reloaded class has a different CRC64 than what CoverageBuilder stored earlier.
185190 JaCoCoXmlReportGenerator generator = new JaCoCoXmlReportGenerator (
186191 options .getClassDirectoriesOrZips (), options .getLocationIncludeFilter (),
187192 options .getDuplicateClassFileBehavior (), options .shouldIgnoreUncoveredClasses (), wrap (logger ));
You can’t perform that action at this time.
0 commit comments