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