There's probably a better option than a while( true ) loop to begin with, but the reason the first version isn't doing anything is because of the magic optimizing done by the Java compiler (I think...