Is there a simple way to tell which branch I am missing? I.e. I have some code like this:
if (x || y) {
// do stuff
}
In the coverage highlighting there is a yellow dot in Eclipse that says:
1 of 4 branches missed
but I would like to know which branch is missing.
What can x
and y
be?
true || true
is true (Not covered because of JVM optimization: if the first condition is true
, the second won't be evaluated due to short circuit evaluation) false || true
is truetrue || false
is truefalse || false
is false