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,
cmb...@case.edu 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
>