I think you're right except the optimization would happen at runtime. the if (false) is removed by the compiler, but removing the method calls to empty methods happens in the JVM. It is less deterministic.