Following document applies for version 4.0.5 or above
Clover applies some heuristic methods in order to reduce compilation errors connected with lambda
expression instrumentation which are described with more details in
here. During instrumentation Clover looks for invocation of some of
Guava classes' methods which are called with a lambda expression as an argument.
With such conditions Clover rewrites lambda expressions into a block form.
With implemented heuristic, such code:
will be instrumented with the following manner:
This method has its own limitations, however. It does not apply to method references (refer to this article), so we advice to use lambda expressions instead of method references or lower lambda instrumentation level to from "all" to "all_but_references" (see clover-setup).
The other issue you may encounter is compilation error about
unexpected return value
It happens when there's a method with name matching one of the listed below, but taking as an
argument a lambda returning void.
Method list for stream heuristics
The following methods trigger lambda expression to block form rewriting by Clover: