Constructors should not invoke themselves.

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 1.1.4, 1.2.0
    • Component/s: 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);
        }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: