Community
Participate
Working Groups
JDT does not allow the developer to specify the enhanced for loop as an error. When developing code compatible with Java 1.4, enhanced for loops should be treated as errors. In the compiler's property, JDT allows to configure autoboxing/unboxing as compiler errors, but the same is not true for enhanced for loops. Please add this option to the Java->Compiler->Error/Warnings->J2SE 5.0 options tab.
Simply set source level to 1.4, and all 1.5 features will be rejected.