Notice that the Java compiler does not (cannot?) do any complicated analysis to see if one or other of the if branches - or corresponding case parts of a switch statement - *must* be reached.
...