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

REGRESSION/CONFORMANCE: Mustang compiler throws AssertionError (beta2-b71 and higher)

XMLWordPrintable

    • b71
    • 6
    • b86
    • generic, x86
    • generic, windows_xp
    • Verified

      Following code sample causes compiler to throw error
      (tools.jar should be on the classpath):

      - Test.java --------------------------------------------
      import static com.sun.tools.javac.tree.JCTree.Kind;

      public class Test {

          public static void main(String[] args) {
              Kind assign = Kind.ASSIGN;
          }
      }
      --------------------------------------------------------

      Output is:

      An exception has occurred in the compiler (1.6.0-beta2). 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.code.Symbol.clone(Symbol.java:120)
              at com.sun.tools.javac.comp.Resolve.findVar(Resolve.java:488)
              at com.sun.tools.javac.comp.Resolve.findIdent(Resolve.java:985)
              at com.sun.tools.javac.comp.Resolve.resolveIdent(Resolve.java:1167)
              at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:1634)
              at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:1547)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:288)
              at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1719)
              at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:288)
              at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:303)
              at com.sun.tools.javac.comp.Attr.visitVarDef(Attr.java:606)
              at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:691)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:288)
              at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:323)
              at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:339)
              at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:638)
              at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:739)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:288)
              at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:323)
              at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:557)
              at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:639)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:288)
              at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:323)
              at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2590)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2521)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2457)
              at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:891)
              at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:867)
              at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:660)
              at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:633)
              at com.sun.tools.javac.main.Main.compile(Main.java:761)
              at com.sun.tools.javac.main.Main.compile(Main.java:686)
              at com.sun.tools.javac.main.Main.compile(Main.java:675)
              at com.sun.tools.javac.Main.compile(Main.java:70)
              at com.sun.tools.javac.Main.main(Main.java:55)


      If static import is not used, everything works fine:
      --------------------------------------------------------

      public class Test {
          public static void main(String[] args) {
              com.sun.tools.javac.tree.JCTree.Kind assign =
                      com.sun.tools.javac.tree.JCTree.Kind.ASSIGN;
          }
      }
      --------------------------------------------------------

            ahe Peter Ahe
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: