Name: ###@###.### Date: 09/05/96
a variable is not considered as definitely assigned after the
boolean operator ! when true though it is definitely assigned
after its operand when false. This contradicts the following
assertion:
V is definitely assigned after !a when true iff V is definitely
assigned after a when false. (Java Language Specification,
section 16.1.5)
Test: compilation of the following test
public class test
{
public static void main()
{
boolean b;
boolean r = false;
boolean f = false;
if (!(f || (b = r)))
r = !b;
System.out.println(r);
}
}
produces such diagnostics:
novo40% javac test.java
test.java:10: Variable b may not have been initialized.
r = !b;
^
1 error
======================================================================