PIIFS - Provide Incremental In For-Statement or use while-statement

Checks if third argument of the for-statement is missing.

Wrong

for ( Enumeration enum = getEnum(); enum.hasMoreElements(); ) {
    Object o = enum.nextElement();
    doSomeProc(o);
}

Tip: Either provide incremental part of a for-structure or cast for-statement into a while-statement.

Right

Enumeration enum = getEnum();
while (enum.hasMoreElements())
{
    Object o = enum.nextElement();
    doSomeProc(o);
}