JaCoCo coverage check warns about non-existent class

1,337 views
Skip to first unread message

sunda...@gmail.com

unread,
Dec 11, 2014, 5:04:55 PM12/11/14
to jac...@googlegroups.com
[WARNING] Rule violated for class com.foo.bar.EntityMessageHandlerImpl.1: lines covered ratio is 0.00, but expected minimum is 0.75

I do have a class called com.foo.bar.EntityMessageHandlerImpl, and I have added an <exclude> in the pom file for it. But until I add an explicit exclude also for com.foo.bar.EntityMessageHandlerImpl.1 (notice the dot-one at the end), build will not succeed.

This only happens to a couple of my classes. I have a mix of classes in my exclude and most of them are ignored if the coverage is below min limit.

What can I do to help debug this further?

Thanks
-Sundar


Marc R. Hoffmann

unread,
Dec 14, 2014, 5:13:18 AM12/14/14
to jac...@googlegroups.com
Hi,

this is a inner class. Try to exclude with a wildcard, this should also
exclude inner classes: com.foo.bar.EntityMessageHandlerImpl*

Regards,
-marc

Sundar Rajan

unread,
Dec 15, 2014, 12:35:51 PM12/15/14
to jac...@googlegroups.com
Thanks Marc,

Yes I already excluded with a wildcard because the other class it insisted on being 0% coverage is EntityMessageHandlerImpl.1.
Is there a pattern on when specifically the inner class is considered? I am puzzled because this class is very similar to some other classes which don't have the inner class being called out. What is the inner class here anyways? Is it because it implements an interface? Many other classes do and don't get called out.

Thanks so much for responding. This is obviously non-critical since I have a workaround, but I would love to have full understanding of what's going on.

Regards
-Sundar



--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/qoJ2jxQr50E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/548D62B8.2030602%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Marc R. Hoffmann

unread,
Dec 15, 2014, 1:01:51 PM12/15/14
to jac...@googlegroups.com
Hi Sundar,

The wildcards should always work, there is no specific logic for inner classes.

Hard to tell what causes the compiler to create a anonymous inner class without seeing the source code. The fact that your class implements an interface is for sure not responsible. Could be a actual anonymous inner class declaration in your code. Also some compiler create such classes e.g. for switches on enum types.

Best regards,
-marc

On 15.12.14 18:35, Sundar Rajan wrote:

Sundar Rajan

unread,
Dec 15, 2014, 3:29:30 PM12/15/14
to jac...@googlegroups.com

That makes sense. Thanks so much.

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/qoJ2jxQr50E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/548F220A.5040208%40mountainminds.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages