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

DA treatment of return statements in constructors

XMLWordPrintable

    • mantis
    • generic
    • solaris_8

      javac fails the following tests.


      /*
       * @test @(#)T4721062a.java 1.1 02/07/31
       * @bug 4721062
       * @summary DA treatment of return statements in constructors
       * @author Neal Gafter (gafter)
       *
       * @compile/fail T4721062a.java
       */

      class T4721062a {
          final int i;
          T4721062a() {
              if (true)
                  return;
              i = 1;
          }
      }





      /*
       * @test @(#)T4721062b.java 1.1 02/07/31
       * @bug 4721062
       * @summary DA treatment of return statements in constructors
       * @author Neal Gafter (gafter)
       *
       * @compile/fail T4721062b.java
       */

      class T4721062b {
          final int i;
          T4721062b(boolean b) {
              if (b)
                  return;
              i = 1;
          }
      }







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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: