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

eou: Diagnostic for constructor call prior to 'super()' call is unclear

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 1.1.4, 1.1.7
    • tools
    • x86
    • windows_95, windows_nt



      Name: joT67522 Date: 11/18/97


      In the following source code, the error message is referring to the implied reference
      to the this pointer which is passed to the inner class c'tor. This message is confusing
      since the user never sees the this pointer to which it is referring. Perhaps the message
      in this special case could explicitly state that an the c'tor for and inner class cannot be
      called in this context.


      public class outerobject
      {
         class innerobject
          {
          }

       public outerobject(Object o)
          {
         }

          public outerobject(int i)
          {
      // generates "Error: c:\Development\swing-0.5.1\com\sun\java\swing\nothis.java(18):
      // Can't reference this before the superclass constructor has been called."

      // since new inner object cannot obtain a implied pointer to outer object until it is contructed

             this (new innerobject());
          }

      }
      (Review ID: 20447)
      ======================================================================

            gafter Neal Gafter (Inactive)
            johsunw Joon Oh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: