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

compiler does not spot mutually recursive constructors

    XMLWordPrintable

Details

    • hopper
    • generic, sparc
    • generic, solaris_2.5, solaris_2.5.1, solaris_2.6, solaris_7
    • Verified

    Description

      The compiler detects recursive constructors but not mutually recursive
      constructors.

      // This class is faulted
      class SomeClass
      {
        SomeClass(String s) {
          this("recursive " + s);
        }
      }



      // This class is not faulted
      class SomeClass
      {
        SomeClass(String s) {
          this(s.charAt(0));
        }

        SomeClass(char c) {
          this(String.valueOf(c));
        }
      }

      Attachments

        Issue Links

          Activity

            People

              gafter Neal Gafter
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: