-
Bug
-
Resolution: Fixed
-
P1
-
7
-
b145
-
x86
-
solaris_nevada
-
Verified
The javadoc comments for all of BatchUpdateException's constructors that don't take a cause argument, say that initCause() can be called to initialize the cause:
> The cause is not initialized, and may subsequently be initialized by a call
> to the Throwable.initCause(java.lang.Throwable) method.
As of b142, this is no longer true (also tested b143 and b144). For example, the following code
BatchUpdateException bue = new BatchUpdateException();
bue.initCause(new Throwable());
results in this exception being thrown:
Exception in thread "main" java.lang.IllegalStateException: Can't overwrite cause
at java.lang.Throwable.initCause(Throwable.java:456)
at BUE.main(BUE.java:6)
> The cause is not initialized, and may subsequently be initialized by a call
> to the Throwable.initCause(java.lang.Throwable) method.
As of b142, this is no longer true (also tested b143 and b144). For example, the following code
BatchUpdateException bue = new BatchUpdateException();
bue.initCause(new Throwable());
results in this exception being thrown:
Exception in thread "main" java.lang.IllegalStateException: Can't overwrite cause
at java.lang.Throwable.initCause(Throwable.java:456)
at BUE.main(BUE.java:6)
- relates to
-
JDK-7038565 address Findbugs issue in BatchUpdateException
- Closed