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

Object class has no superclass: javac dies on "super()" in Object constructor

XMLWordPrintable

    • b19
    • x86, sparc
    • solaris_2.5.1, windows_nt
    • Verified



      Name: tb29552 Date: 11/18/97


      Submitter of this Incident modified java/lang/Object.java as follows:

      In a copy of java/lang/Object.java, add the
      default constructor method containing a
      call to super(), as follows:

         public Object () {
            super();
         }

      Attempt to compile the file and get the exception

      java.lang.NullPointerException
              at sun.tools.tree.MethodExpression.checkValue(MethodExpression.java:72)
              at sun.tools.tree.MethodExpression.check(MethodExpression.java:340)
              at sun.tools.tree.ExpressionStatement.check(ExpressionStatement.java:46)
              at sun.tools.tree.Statement.checkBlockStatement(Statement.java:120)
              at sun.tools.tree.CompoundStatement.check(CompoundStatement.java:70)
              at sun.tools.tree.Statement.checkMethod(Statement.java:98)
              at sun.tools.javac.SourceField.check(SourceField.java:402)
              at sun.tools.javac.SourceClass.checkFields(SourceClass.java:852)
              at sun.tools.javac.SourceClass.checkInternal(SourceClass.java:615)
              at sun.tools.javac.SourceClass.check(SourceClass.java:566)
              at sun.tools.javac.Main.compile(Main.java:318)
              at sun.tools.javac.Main.main(Main.java:473)

      The Object class has no superclass, so constructor
      chaining can't work. But it ought to fail gracefully.
      (Review ID: 14418)
      ======================================================================

            ahe Peter Ahe
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: