On Fri, 28 Jan 2022 23:54:54 GMT, Mandy Chung <mch...@openjdk.org> wrote:
> `ObjectInputStream::readObject` does not specify that > `InvalidObjectException` may be thrown. > Have you considered throwing `InvalidClassException` be an alternative? i.e. > extend `InvalidClassException` to report failure in creating the proxy class > during deserialization. There are other checks related to the Proxy interfaces that throw InvalidObjectException. InvalidClassException was a close second. The throwing of `IllegalAccessException` is not described for `readObject` and `InvalidObjectException` is a subclass of `IOException` that acts as a catch-all. ------------- PR: https://git.openjdk.java.net/jdk/pull/7274