-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.4.0
-
generic
-
solaris_8
Detected by jikes non-jls-jsr41.4-definite-unassignment-try-9
frog:~/workspaces/test/jikes $ cat -n T.java
1 class T {
2 public static void main(String[] args) {
3 final boolean b;
4 try {
5 throw new RuntimeException();
6 } catch (RuntimeException e) {
7 assert true : b = true;
8 } finally {
9 b = false;
10 }
11 }
12 }
frog:~/workspaces/test/jikes $ newjavac -source 1.4 T.java
T.java:9: variable b might already have been assigned to
b = false;
^
1 error
frog:~/workspaces/test/jikes $
frog:~/workspaces/test/jikes $ cat -n T.java
1 class T {
2 public static void main(String[] args) {
3 final boolean b;
4 try {
5 throw new RuntimeException();
6 } catch (RuntimeException e) {
7 assert true : b = true;
8 } finally {
9 b = false;
10 }
11 }
12 }
frog:~/workspaces/test/jikes $ newjavac -source 1.4 T.java
T.java:9: variable b might already have been assigned to
b = false;
^
1 error
frog:~/workspaces/test/jikes $
- relates to
-
JDK-4643292 definite unassignment versus assertions
- Closed