Wondering if this is a bug?

30 views
Skip to first unread message

Juan Duran

unread,
Oct 22, 2024, 6:57:33 PM10/22/24
to JaCoCo and EclEmma Users
Hi all,

I am using Eclipse (4.32.0) on Windows with the EclEmma plugin v3.1.9. I'm running JUnit test cases that cover catch statements which invoke private methods.

I've noticed that the line that invokes the private method is highlighted in red, while the code in the actual private method shows green. Can someone confirm whether this is expected behavior?

Screenshot attached.

Thanks!



Screenshot 2024-10-22 154910.png

Marc Hoffmann

unread,
Oct 23, 2024, 1:21:27 AM10/23/24
to JaCoCo and EclEmma Users
Hi,

this is a known limitation, see FAQ:

Source code lines with exceptions show no coverage. Why?

JaCoCo determines code execution with so called probes. Probes are inserted into the control flow at certain positions. Code is considered as executed when a subsequent probe has been executed. In case of exceptions such a sequence of instructions is aborted somewhere in the middle and the corresponding lines of source code are not marked as covered. 

Regerds,
-marc

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/6d1a72a2-06ca-4dc9-9a33-24718c0fe825n%40googlegroups.com.
<Screenshot 2024-10-22 154910.png>

Juan Duran

unread,
Oct 24, 2024, 5:13:50 PM10/24/24
to JaCoCo and EclEmma Users
Thanks for pointing that out.  
Reply all
Reply to author
Forward
0 new messages