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

anonymous inner class with null as a parameter causes CompilerError

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description



      Name: laC46010 Date: 07/21/97



      Declaration of an anonymous inner class with null keyword as a
      parameter causes javac to throw sun.tools.java.CompilerError.

      All JDK compilers from 1.1_Final thru 1.2C fail to compile
      example "Test.java" (see source below), producing the following
      compile-time exception:

      > /export/ld14/java/dest/jdk1.2/solaris/bin/javac -d . Test.java
      sun.tools.java.CompilerError: stackSize null
      at java.lang.Throwable.fillInStackTrace(Native Method)
      at java.lang.Throwable.<init>(Throwable.java:89)
      at java.lang.Error.<init>(Error.java:61)
      at sun.tools.java.CompilerError.<init>(CompilerError.java:37)
      at sun.tools.java.Type.stackSize(Type.java:342)
      at sun.tools.tree.Context.declare(Context.java:116)
      at sun.tools.javac.SourceMember.check(SourceMember.java:376)
      at sun.tools.javac.SourceClass.checkMembers(SourceClass.java:922)
      at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:685)
      at sun.tools.javac.SourceClass.checkLocalClass(SourceClass.java:1126)
      at sun.tools.tree.NewInstanceExpression.checkValue(NewInstanceExpression.java:144)
      at sun.tools.tree.Expression.checkInitializer(Expression.java:173)
      at sun.tools.javac.SourceMember.check(SourceMember.java:434)
      at sun.tools.javac.SourceClass.checkMembers(SourceClass.java:908)
      at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:685)
      at sun.tools.javac.SourceClass.check(SourceClass.java:636)
      at sun.tools.javac.Main.compile(Main.java:312)
      at sun.tools.javac.Main.main(Main.java:467)
      error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
      1 error

      --------------------Test.java----------------------
      class Test {
      Object o = new Object( null ) {};
      }
      --------------------------------------------------------------------------------

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tturnidgsunw Todd Turnidge (Inactive)
                Reporter:
                leosunw Leo Leo (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: