originally reported in #122
2. The RenderFileAction NPE
java.lang.NullPointerException
at ...reporters.html.RenderFileAction.call(RenderFileAction.java:111)
at ...util.CloverExecutors$LoggingCallable.call(CloverExecutors.java:91)
This is still reproducible on 5.0.0. @JasonWThompson's diagnosis was correct. The details:
RenderFileAction holds its column/context state in two static fields:
protected static ThreadLocal<List<Column>> columnsTL;
protected static ThreadLocal<ContextSet> contextSetTL;
but their lifecycle is owned by HtmlReporter, which calls initThreadLocals() before submitting render tasks and resetThreadLocals() in a finally block — and that reset assigns the statics back to null.
I've reproduced this with a unit test on the 5.0.x branch.
Fix direction: make this state per-report rather than static, so each HtmlReporter owns its own lifecycle and one report's cleanup can't affect another's in-flight tasks. Additionally, the finally reset shouldn't run while tasks may still be executing.
originally reported in #122
2. The
RenderFileActionNPEThis is still reproducible on 5.0.0. @JasonWThompson's diagnosis was correct. The details:
RenderFileActionholds its column/context state in two static fields:but their lifecycle is owned by
HtmlReporter, which callsinitThreadLocals()before submitting render tasks andresetThreadLocals()in afinallyblock — and that reset assigns the statics back tonull.I've reproduced this with a unit test on the 5.0.x branch.
Fix direction: make this state per-report rather than static, so each
HtmlReporterowns its own lifecycle and one report's cleanup can't affect another's in-flight tasks. Additionally, thefinallyreset shouldn't run while tasks may still be executing.