[Bug 3012] [IcedTea7] Backport "8069181: java.lang.AssertionError when compiling JDK 1.4 code in JDK 8"

bugzilla-daemon at icedtea.classpath.org bugzilla-daemon at icedtea.classpath.org
Fri Jun 10 16:57:08 UTC 2016


http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=3012

Andrew John Hughes <gnu.andrew at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=1015612

--- Comment #1 from Andrew John Hughes <gnu.andrew at redhat.com> ---
Succeeds with IcedTea 1.x/OpenJDK 6 and IcedTea 3.x/OpenJDK 8.
Fails with IcedTea 2.x/OpenJDK 7.

$ /usr/lib/jvm/icedtea-6/bin/javac -source 1.4 TestEnum.java 
TestEnum.java:7: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
(use -source 5 or higher to use 'enum' as a keyword)
    for (Enumeration enum = hTable.keys();;){
                     ^
TestEnum.java:8: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
(use -source 5 or higher to use 'enum' as a keyword)
        if(!enum.hasMoreElements())
            ^
TestEnum.java:10: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
(use -source 5 or higher to use 'enum' as a keyword)
        enum.nextElement();
        ^
3 warnings

$ /usr/lib/jvm/icedtea-7/bin/javac -source 1.4 TestEnum.java 
warning: [options] bootstrap class path not set in conjunction with -source 1.4
TestEnum.java:7: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
    for (Enumeration enum = hTable.keys();;){
                     ^
  (use -source 5 or higher to use 'enum' as a keyword)
TestEnum.java:8: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
        if(!enum.hasMoreElements())
            ^
  (use -source 5 or higher to use 'enum' as a keyword)
TestEnum.java:10: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
        enum.nextElement();
        ^
  (use -source 5 or higher to use 'enum' as a keyword)
An exception has occurred in the compiler (1.7.0_101). Please file a bug at the
Java Developer Connection (http://java.sun.com/webapps/bugreport)  after
checking the Bug Parade for duplicates. Include your program and the following
diagnostic in your report.  Thank you.
java.lang.AssertionError
    at com.sun.tools.javac.util.Assert.error(Assert.java:126)
    at com.sun.tools.javac.util.Assert.check(Assert.java:45)
    at com.sun.tools.javac.comp.Attr.attribIdentAsEnumType(Attr.java:678)
    at com.sun.tools.javac.comp.MemberEnter.visitVarDef(MemberEnter.java:629)
    at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:725)
    at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:401)
    at com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:855)
    at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:725)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
    at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:480)
    at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:496)
    at com.sun.tools.javac.comp.Attr.visitForLoop(Attr.java:939)
    at com.sun.tools.javac.tree.JCTree$JCForLoop.accept(JCTree.java:872)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
    at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:480)
    at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:496)
    at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:918)
    at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:781)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
    at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:480)
    at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:836)
    at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:669)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:431)
    at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:418)
    at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:480)
    at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:3250)
    at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3173)
    at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:3109)
    at com.sun.tools.javac.comp.Attr.attrib(Attr.java:3083)
    at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1184)
    at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:870)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:829)
    at com.sun.tools.javac.main.Main.compile(Main.java:439)
    at com.sun.tools.javac.main.Main.compile(Main.java:353)
    at com.sun.tools.javac.main.Main.compile(Main.java:342)
    at com.sun.tools.javac.main.Main.compile(Main.java:333)
    at com.sun.tools.javac.Main.compile(Main.java:76)
    at com.sun.tools.javac.Main.main(Main.java:61)

$ /usr/lib/jvm/icedtea-8/bin/javac -source 1.4 TestEnum.java 
warning: [options] bootstrap class path not set in conjunction with -source 1.4
warning: [options] source value 1.4 is obsolete and will be removed in a future
release
warning: [options] target value 1.4 is obsolete and will be removed in a future
release
warning: [options] To suppress warnings about obsolete options, use
-Xlint:-options.
TestEnum.java:7: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
    for (Enumeration enum = hTable.keys();;){
                     ^
  (use -source 5 or higher to use 'enum' as a keyword)
TestEnum.java:8: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
        if(!enum.hasMoreElements())
            ^
  (use -source 5 or higher to use 'enum' as a keyword)
TestEnum.java:10: warning: as of release 5, 'enum' is a keyword, and may not be
used as an identifier
        enum.nextElement();
        ^
  (use -source 5 or higher to use 'enum' as a keyword)
7 warnings

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20160610/02c7f99f/attachment-0001.html>


More information about the distro-pkg-dev mailing list