-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1.4
-
generic
-
generic
allan.jacobs@Eng 1997-10-27
Blank finals should only be initialized once. Static blank final
variables can be assigned two values in try and catch blocks. The
following code is derived from Modena (v 2.2) test niner127.
algol% cat X.java
class X {
static final int i ;
static {
try{
i = 3;
throw new Throwable();
}catch(Throwable thb) { i = 4;}
}
public static void main( String[] argv ) {
X ox = new X();
System.out.println(ox.i);
}
}
algol% javac -d . X.java
algol% java X
4
- duplicates
-
JDK-4068688 Definite unassignment problem with try/catch
- Closed