Example

public class ClassA {

public void methodA (Vector aVector) {

Enumeration e = aVector.elements();
while (e.hasMoreElements()) {

Object obj = e.nextElement();
// do something with obj...
}
}


Solution
Avoid using an Enumeration to control a loop, use an Iterator instead.

public class ClassA {

public void methodA (Vector aVector) {

Iterator it = aVector.iterator();
while (it.hasNext()) {

Object obj = it.next();
// do something with obj...
}
}