Your compiler should be showing a warning on that if statement. Something like:
warning: [empty] empty statement after if

Add the -Xlint option to the compiler's options so that it will give the...