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

Constructors should not invoke themselves.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.4, 1.2.0
    • tools
    • generic
    • generic


      allan.jacobs@Eng 1997-10-17

      Section 8.6.5 says that it is a compile time error for a constructor
      to directly or indirectly invoke itself through a series of one or
      more explicit constructor invocations involving "this". Javac is
      in violation of this part of the specification.

      Adapted from Modena test n0865201:

      class X {
       X(int j) {
          this();
        }
       X() {
         this(10);
        }
      }

            tturnidgsunw Todd Turnidge (Inactive)
            ajacobssunw Allan Jacobs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: