-
Bug
-
Resolution: Fixed
-
P3
-
1.0.2
-
1.1
-
sparc
-
generic
-
Not verified
Name: ###@###.### Date: 09/05/96
a variable is not considered as definitely assigned after the
boolean negation when false though it is definitely assigned
after its operand when true. This contradicts the following
assertion:
V is definitely assigned after !a when false iff V is definitely
assigned after a when true. (Java Language Specification,
section 16.1.5)
Test: compilation of the following test
public class test
{
public static void main()
{
boolean b;
boolean r = true;
boolean t = true;
if (!(t && (b = r)));
else
r = !b;
System.out.println(r);
}
}
produces such diagnostics:
novo40% javac test.java
test.java:11: Variable b may not have been initialized.
r = !b;
^
1 error
======================================================================