# "a |= b" differs from "a = a || b;"

This runs without problem:

Integer a = null;

boolean error = true;

error = error || (a.intValue() > 0);

But this gives an NPE:

Integer a = null;

boolean error = true;

error |= (a.intValue() > 0);

This is because |= is bitwise or and || is logical or. A boolean could technically be seen as a one-bit variable but internally in the jvm it is not a single bit. So the bitwise or can't skip the rest of the expression as long as not all bits are true.