This is a bug fix release which addresses issues found in 3.1.8 and earlier versions of Clover-for-Ant.
1) Two new metrics have been implemented for method context filter:
These two metrics calculate method statements/complexity including the code of all anonymous inline classes declared inside the method. Thanks to this it is possible to distinguish between trivial single-statement methods like:
int getNumber() { return this.number; }
and single-statement methods which actually return more complex data, like:
ActionListener getListener() { return new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("statement #1"); System.out.println("statement #2"); System.out.println("statement #3"); } }; }
In the code sample above, the getListener() method has only one statement: "return new ActionListener()". If you would use a method context filter with maxStatements attribute, like:
<methodContext name="trivial" regexp=".*" maxStatements="1">
then the whole method would be filtered-out (because it contains one "return" statement). If you would use new maxAggregatedStatements, for instance:
<methodContext name="trivial" regexp=".*" maxAggregatedStatements="1">
then the getListener() method would not be filtered out (because it contains 4 statements in total - 1 "return" statement from the method itself and 3 "System.out.println()" statements from anonymous class).
2) The <testsources> tag from <clover-setup> task is now passed to <groovyc> Ant task. Thanks to this you can define custom test detection rules for Groovy code. See clover-setup task for more details.
See also change log for Clover-for-Maven, Clover-for-Eclipse, Clover-for-IDEA.