FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The field COMMIT_ON_ACCEPT_CHANGES is final in the online javadoc of CachedRowSet and in the binary version of java.
Strangely, it is not final in the source code (src.zip).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Change the value of COMMIT_ON_ACCEPT_CHANGES
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Modification of the value of the field.
ACTUAL -
Compilation error.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
AClass2.java:5: cannot assign a value to final variable COMMIT_ON_ACCEPT_CHANGES
COMMIT_ON_ACCEPT_CHANGES = false;
^
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.sql.rowset.CachedRowSet;
public abstract class AClass2 implements CachedRowSet {
static {
COMMIT_ON_ACCEPT_CHANGES = false;
}
public static boolean getConstant() {
return COMMIT_ON_ACCEPT_CHANGES;
}
}
class Main {
public static void main(String[] args) {
System.out.println(AClass2.getConstant());
}
}
---------- END SOURCE ----------
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The field COMMIT_ON_ACCEPT_CHANGES is final in the online javadoc of CachedRowSet and in the binary version of java.
Strangely, it is not final in the source code (src.zip).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Change the value of COMMIT_ON_ACCEPT_CHANGES
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Modification of the value of the field.
ACTUAL -
Compilation error.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
AClass2.java:5: cannot assign a value to final variable COMMIT_ON_ACCEPT_CHANGES
COMMIT_ON_ACCEPT_CHANGES = false;
^
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.sql.rowset.CachedRowSet;
public abstract class AClass2 implements CachedRowSet {
static {
COMMIT_ON_ACCEPT_CHANGES = false;
}
public static boolean getConstant() {
return COMMIT_ON_ACCEPT_CHANGES;
}
}
class Main {
public static void main(String[] args) {
System.out.println(AClass2.getConstant());
}
}
---------- END SOURCE ----------