RFR: 8280642: IllegalAccessError thrown by ObjectInputStream.resolveProxyClass is not handled

Roger Riggs rriggs at openjdk.java.net
Sat Jan 29 00:21:08 UTC 2022


On Fri, 28 Jan 2022 23:54:54 GMT, Mandy Chung <mchung at 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


More information about the core-libs-dev mailing list