Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8069181

java.lang.AssertionError when compiling JDK 1.4 code in JDK 8

XMLWordPrintable

    • b01

        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

              mcimadamore Maurizio Cimadamore
              shadowbug Shadow Bug
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: