Project: clover
Issue CLOV-1192: Create ClassInfo objects for anonymous inline classes
During implementation of CLOV-1162 I've found that anonymous inline classes does not have their own ClassInfo object crated. Instead of this, methods of inline class are added to the enclosing class. For instance, a following code: {code:java} public class AggregatedMetrics { /** * Inner class, case with a method having an inline anonymous class * statements = 3 (sum of direct methods' statements) * aggregatedStatements = 5 (sum of direct methods' aggregated statements) */ class C { /** * Method: statements = 2; aggregatedStatements = 4 (method's statements + inline class aggregated statements) */ Iterator methodThree() { int d = 4; /** * Inline class: statements = aggregatedStatements = 2 (sum of its methods) */ return new InstrumentationSessionImplTestSample2() { /** statements = aggregatedStatements = 1 */ public boolean hasNext() { return false; } /** statements = aggregatedStatements = 1 */ public Object next() { return null; } /** statements = aggregatedStatements = 0 */ public void remove() { } }; } /** statements = aggregatedStatements = 1 */ void methodFour() { int e = 5; } } } {code} is stored in clover database in this way: {code:xml}	{code} It means that on reports the AggregatedMetrics.C class is presented as having 5 methods, while it has 2 actually. It's not a bug. There was a design decision to not present anonymous classes in a report. Possible improvement: * create ClassInfo objects for anonymous classes * add option for reporting whether to show anonymous classes (like InstrumentationSessionImplTestSample2$1) or not
Story points: 5