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

Internal compiler error, but only when run from image?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • tools
    • generic
    • generic

      The following (incorrect) program:
      ----------------------------------------------------------------
      public class TmpTest {
          public static void main(String[] args) {new ThreadGroup() {};}
      }
      ----------------------------------------------------------------
      elicits the following internal error:

      /u/martin/ws/ueh/build/solaris-sparc/j2sdk-image/bin/javac -source 1.5 TmpTest.java
      TmpTest.java:2: cannot find symbol
      symbol : constructor ThreadGroup()
      location: class java.lang.ThreadGroup
          public static void main(String[] args) {new ThreadGroup() {};}
                                                  ^
      TmpTest.java:2: cannot find symbol
      symbol : constructor ThreadGroup()
      location: class java.lang.ThreadGroup
          public static void main(String[] args) {new ThreadGroup() {};}
                                                                    ^
      An exception has occurred in the compiler (1.5.0-internal). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) 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.comp.Attr.visitNewClass(Attr.java:1331)
      at com.sun.tools.javac.tree.Tree$NewClass.accept(Tree.java:840)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:256)
      at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:278)
      at com.sun.tools.javac.comp.Attr.visitExec(Attr.java:865)
      at com.sun.tools.javac.tree.Tree$Exec.accept(Tree.java:734)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:256)
      at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:291)
      at com.sun.tools.javac.comp.Attr.attribStats(Attr.java:307)
      at com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:572)
      at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:540)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:256)
      at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:291)
      at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:510)
      at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:482)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:256)
      at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:291)
      at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2337)
      at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2270)
      at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2221)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:410)
      at com.sun.tools.javac.main.Main.compile(Main.java:586)
      at com.sun.tools.javac.main.Main.compile(Main.java:538)
      at com.sun.tools.javac.Main.compile(Main.java:44)
      at com.sun.tools.javac.Main.main(Main.java:35)

      Surprisingly, when run out of a developer's build tree, it acts differently,
      and more reasonably:

      /u/martin/ws/ueh/build/solaris-sparc/bin/javac -source 1.5 TmpTest.java
      TmpTest.java:2: cannot find symbol
      symbol : constructor ThreadGroup()
      location: class java.lang.ThreadGroup
          public static void main(String[] args) {new ThreadGroup() {};}
                                                  ^
      TmpTest.java:2: cannot find symbol
      symbol : constructor ThreadGroup()
      location: class java.lang.ThreadGroup
          public static void main(String[] args) {new ThreadGroup() {};}
                                                                    ^
      2 errors

      ###@###.### 2004-03-06

            never Tom Rodriguez
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: