Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.0.7
-
None
Description
Closures generated by the Groovy compiler contain both "doCall()" and "call()" methods, where "call()" always delegate to the "doCall()".
Typically, users will use a short form of closure invocation, which Groovy translates to direct call of "doCall()". This means that the generated "call()" method will never get invoked in a typical scenario.
When using JaCoCo for code coverage, it will report the "call()" method as unused.
For these reasons, it looks sensible to annotate all generated "call()" methods with "@Generated". That way "call()" method will not appear in the coverage report, while the "doCall()", which contains the implementation of a closure body, will be reported as covered.