Name: laC46010 Date: 07/22/97
All JDK versions from 1.1_Final thru 1.2C fail to pass
test icls11608, generated from template icls11691.
The test reveals that there's a way for a blank final variable
to be assigned twice within a for statement. Nevertheless, Inner
Classes In Java 1.1 specification states:
"A blank final is final variable declaration (of any kind)
which lacks an initializer. A blank final must be assigned an
initial value, exactly once, before it is used."
Example "Test.java" (see source code below) shows this failure:
> /export/ld14/java/dest/jdk1.2/solaris/bin/javac -d . Test.java
> /export/ld14/java/dest/jdk1.2/solaris/bin/java -verify Test
a=1
a=2
a=3
a=4
>
Note, that there is very similar (most likely the same) bug
with ID 4030396, which concerns switch statement.
--------------------Test.java----------------------
public class Test {
public static void main(String[] argv) {
int k=0;
for (final int a;;) {
k++;
a=k;
System.out.println("a="+a);
if (k>3)
return;
}
}
}
--------------------------------------------------------------------------------
======================================================================