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

javac CompilerError. Instantiation of inner class with private constructor.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.0, 1.2.2
    • tools
    • generic, x86, sparc
    • generic, solaris_2.6, windows_nt



      Name: skT88420 Date: 08/12/99


      1. The following source leads to a compiler error.

      2.
      interface a
      {
      class b
      {
      private b()
      {
      }
      }

      final public static b c = new b();
      }

      3., 4.
      C:\>javac a.java
      sun.tools.java.CompilerError: illegal class modifiers
              at sun.tools.javac.SourceClass.assertModifiers(SourceClass.java:2059)
              at sun.tools.javac.SourceClass.compileClass(SourceClass.java:2577)
              at sun.tools.javac.SourceClass.compile(SourceClass.java:2039)
              at sun.tools.javac.Main.compile(Main.java:567)
              at sun.tools.javac.Main.main(Main.java:733)
      error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
      1 error

      5.
      C:\>java -version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)

      C:\>java -fullversion
      java full version "JDK-1.2.2-W"

      6. I think there where no additional configuration leading to that problem.
      Testing on another machine using JDK1.2 leads to the same problem.
      (Review ID: 93833)
      ======================================================================

      Name: krT82822 Date: 12/09/99


      12/9/99 eval1127@eng -- 4262105, and possibly 4167826

      java version "1.2"
      Classic VM (build JDK-1.2-V, green threads, sunwjit)


      public interface A {
          class E implements A {
              private E() {}
              public void m() {}
          }
          void m();
          public static E e = new E();
      }

      > javac A.java

      sun.tools.java.CompilerError: illegal class modifiers
              at sun.tools.javac.SourceClass.assertModifiers(Compiled Code)
              at sun.tools.javac.SourceClass.compileClass(Compiled Code)
              at sun.tools.javac.SourceClass.compile(Compiled Code)
              at sun.tools.javac.Main.compile(Compiled Code)
              at sun.tools.javac.Main.main(Compiled Code)
      error: An error has occurred in the compiler; please file a bug report (http://j

      I tried this with several versions but the bug always occurred.
      (Review ID: 98844)
      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: