| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The markGeneratedEqualsHashCode task was modifying .class files in-place in build/classes/java/main and the jar task depended on it, causing bytecode with injected @generated annotations to end up in the published JAR. Fix by copying classes to a separate build/classes-jacoco directory for modification, and only wiring jacocoTestReport (not jar) to depend on the task. https://claude.ai/code/session_01XDZqTUKLBoSJpGPGx9Amxg
Test ReportTest Results
Code Coverage (Java 25)
Changed Class Coverage (59 classes)
|
Sorry, something went wrong.
jacocoTestReport was only including execution data from the JUnit `test` task. The `testng` task also produces a JaCoCo .exec file but it was never merged into the report, causing code exercised only by TestNG tests to show zero coverage. Add `testng` to dependsOn and set executionData to include all .exec files from the jacoco output directory. https://claude.ai/code/session_01XDZqTUKLBoSJpGPGx9Amxg
The markGeneratedEqualsHashCode task copied class files and then modified them with ASM to add @generated annotations on equals/hashCode methods. This changed the bytecode CRC64 checksums, so JaCoCo could not correlate its execution data (recorded against the original classes) with the modified copies. Result: 61 classes with equals/hashCode showed ZERO coverage across all metrics — not just on equals/hashCode, but on every line, branch, and method in the class. Fix by pointing classDirectories back at the original classes/java/main directory and removing the markGeneratedEqualsHashCode task entirely. The small trade-off is that equals/hashCode methods now appear in coverage metrics, but all 61 affected classes regain their full coverage. https://claude.ai/code/session_01XDZqTUKLBoSJpGPGx9Amxg
|
I have to look more closely at this - so far only a quick Claude attempt |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The markGeneratedEqualsHashCode task was modifying .class files in-place
in build/classes/java/main and the jar task depended on it, causing
bytecode with injected @generated annotations to end up in the published
JAR. Fix by copying classes to a separate build/classes-jacoco directory
for modification, and only wiring jacocoTestReport (not jar) to depend
on the task.
https://claude.ai/code/session_01XDZqTUKLBoSJpGPGx9Amxg