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

DA versus assert: Expression2 only affects DA in exceptional cases

    Details

    • Subcomponent:
    • Resolved In Build:
      hopper
    • CPU:
      generic
    • OS:
      solaris_7
    • Verification:
      Verified

      Description

      There should be no error in this program.

      $ cat -n T.java
           1 class T { boolean z;
           2 void f() {
           3 final boolean x;
           4 assert z : (x = z) ;
           5 x = false;
           6 }
           7 }
      $ newjavac -source 1.4 T.java
      T.java:5: variable x might already have been assigned to
              x = false;
              ^
      1 error
      $

        Attachments

          Issue Links

            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: