Reports while loops that iterate over collections and can be replaced with enhanced for loops (foreach iteration syntax).

Example:


  Iterator it = c.iterator();
  while(it.hasNext()) {
    Object obj = it.next();
    System.out.println(obj);
  }

Can be replaced with:


  for (Object obj : c) {
    System.out.println(obj);
  }