relying on Java's short-circuiting evaluation (coding style)
coding-style, java
Solution
You certainly can and should rely on short circuiting in expressions, but the example you give is just bad programming. The logic of the expression should match the comment and the human-readable logic of the test. The optimizer fully understands boolean logic and will optimize away any apparent inefficiency that your teammate might complain about.
The most important thing is to make the code clear and understandable for the developer. Writing clever code to prove how clever you are is never a good practice.
Problem
Is it ever a good coding style to heavily rely on short-circuit in boolean evaluation? I've known someone who loves to do this. For instance, if the business logic is "If Alice is not hungry OR if both Alice and Bob are hungry", instead of writing ``` // if Alice is not hungry or both alice and bob are hungry if (!A || A && B)` ``` he would write ``` // if Alice is not hungry OR both alice and bob are hungry if (!A || B) ``` arguing that `||` is short-circuited, so the right-operand is evaluated if and only if the first one is `false` (which means `A = true`). (The annoying thing about this is that at first glance, you would think this is a bug but then feel you would look stupid if you change it to what is more obvious!)