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

DA versus assert: Expression2 only affects DA in exceptional cases

XMLWordPrintable

    • hopper
    • generic
    • solaris_7
    • Verified

      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
      $

            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: