Code coverage reporting 1 of 2 branches missed

11 views
Skip to first unread message

Vibor Pokupec

unread,
Jul 15, 2024, 3:59:02 PM (8 days ago) Jul 15
to JaCoCo and EclEmma Users
Hi everybody,

I have a code sample on github: https://github.com/FERViborg/jacoco-bug-coverage-branch/tree/production and I tried to keep it as simple as possible but it is a bit of the complex problem.

All these conditions must be met:
1. there must be try-catch with a resource
2. there must be an if statement in that try block
3. there must be a return statement with the complex object inside of that if statement

When running:
& "C:\Maven\3.9.1\bin\mvn.cmd" clean compile verify -f "c:\Repositories\Jacoco\pom.xml"

I do not get full coverage because character } on line 13 of the class JacocoBadCoverageExample will report:
1 of 2 branches missed.

Is there a way to solve this?

Best regards,
Vibor

Vibor Pokupec

unread,
Jul 16, 2024, 1:30:20 AM (8 days ago) Jul 16
to JaCoCo and EclEmma Users
I've pushed a new, bit simplified version of the code. The error is now on line 11.
Reply all
Reply to author
Forward
0 new messages