Integrated: JDK-8282696: Add constructors taking a cause to InvalidObjectException and InvalidClassException

Joe Darcy darcy at openjdk.java.net
Mon Mar 7 14:52:10 UTC 2022


On Sat, 5 Mar 2022 02:57:47 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> Occasionally in core-libs we've discussed whether or not to do a pass over the exception classes and proactively add any of four missing convention constructors per java.lang.Throwable (no-arg, string, cause, cause and string). Last time this came up, we decided a wide-scale effort wasn't worthwhile.
> 
> Prompted by some other recent work, I decided to take a quick look at the dual-approach: grep for calls to initCause in java.base and seeing which exception classes repeated were initCaused. Those exception classes are good candidates for cause-taking constructors.
> 
> Two such exception classes area InvalidObjectException and InvalidClassException, along with their superclass ObjectStreamException.
> 
> Please also review the CSR: https://bugs.openjdk.java.net/browse/JDK-8282697

This pull request has now been integrated.

Changeset: 104e3cb2
Author:    Joe Darcy <darcy at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/104e3cb24b4de5512abf9f5491f9c530b26838d3
Stats:     212 lines in 7 files changed: 176 ins; 14 del; 22 mod

8282696: Add constructors taking a cause to InvalidObjectException and InvalidClassException

Reviewed-by: lancea

-------------

PR: https://git.openjdk.java.net/jdk/pull/7711


More information about the core-libs-dev mailing list