Hi,

the short circuit results in two separate branching points each containing two branches, so 2+2=4.

You can rewrite the line as

if (0 <= i) if (i < 10)

This is how short circuits expressions get compiled and how JaCoCo sees it.

Regards,
-marc

On 28.03.17 05:04, [email protected] wrote:
Hi,

I have a condition that looks something like this:
if(0 <= i && i < 10)

The coverage report shows 1 of 4 branches missed. I can't expect JaCoCo to 
recognize the semantics of the condition which make it impossible to reach the 
fourth branch (i can't be both less than 0 and greater than 10), but why 
doesn't it just count 3 branches? Thanks to short-circuiting, if the first 
decision is false, it shouldn't matter what the second one is.


Thanks,
Cassidy



--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/14b991db-d6af-8871-0e8a-2242751017f1%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to