Reports for loops which iterate over collections or arrays, and can be replaced with an enhanced for loop (i.e. the foreach iteration syntax).

Use the first checkbox below to find loops involving list.get(index) calls. These loops generally can be replaced with an enhanced for loop, unless they modify underlying list in the process, e.g. by calling list.remove(index). If latter is the case, the enhanced for loop may throw ConcurrentModificationException.

Use the second checkbox below to ignore collections which do not have type parameters. This prevents the creation of enhanced for loop variables of type java.lang.Object and the insertion of casts where the loop variable is used.

This inspection only reports if the language level of the project or module is 5 or higher