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
$
$ 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
$
- relates to
-
JDK-4478838 further assert/DU problems.
- Closed