I am able to reproduce the issue using following sample code:
TestEnum.java
--------------------------------------------
import java.util.Enumeration;
import java.util.Hashtable;
public class TestEnum {
public static void main(String[] args) {
Hashtable hTable = new Hashtable();
hTable.put("hello", "value");
for (Enumeration enum = hTable.keys();;){
if(!enum.hasMoreElements())
break;
enum.nextElement();
}
}
}
--------------------------------------------
Compile using "-source 1.4" option
This code compiles fine with jdk6 but fails with error with jdk8