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

DA treatment of return statements in constructors

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic
    • OS:
      solaris_8

      Description

      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;
          }
      }







        Attachments

          Activity

            People

            Assignee:
            gafter Neal Gafter
            Reporter:
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: