RFR: JDK-8282696: Add constructors take a cause to InvalidObjectException and InvalidClassException [v5]

Joe Darcy darcy at openjdk.java.net
Mon Mar 7 04:35:33 UTC 2022


> 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

Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:

 - Add regression tests.
 - Merge branch 'master' into JDK-8282696
 - Fix more whitespace.
 - Fix whitespace.
 - Respond to review feedback.
 - Retrofit another location.
 - JDK-8282696: Add constructors take a cause to InvalidObjectException and InvalidClassException

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7711/files
  - new: https://git.openjdk.java.net/jdk/pull/7711/files/80f97dcc..2de370f7

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7711&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7711&range=03-04

  Stats: 1346 lines in 43 files changed: 1187 ins; 49 del; 110 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7711.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7711/head:pull/7711

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


More information about the core-libs-dev mailing list