This inspection reports any instances of for loops which iterate over collections or arrays, and can be replaced with the JDK 5.0 "for each" iteration syntax.

The setting Report java.util.List indexed loops is responsible for finding loops involving list.get(index) calls. These loops generally can be replaced with the foreach loops, unless they modify underlying list in the process, e.g. by calling list.remove(index). If latter is the case, foreach form of loop may throw ConcurrentModificationException.

For safety, this inspection is disabled unless the project uses JDK 5.0.

Powered by InspectionGadgets