Skip to main content

Java 7 small proposal (do not allow empty 'if')

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
mgrouch
Offline
Joined: 2006-08-28

I have a small suggestion for java 7. Please do not let compiler to compile this code with empty 'if' (note semicolumn on 'if' line):
if (cond()) ;
{
thisRunsAlways();
}
This code most likely a bug and compiler should have been raising an error, but this code still compiles fine in java 7.

Thanks,
--MG