RFR 8009581: Xpathexception does not honor initcause()
aleksej.efimov at oracle.com
Fri May 31 13:39:31 UTC 2013
Obviously, we can't throw the ISE - it's not described in docs for
Exceptions suggested by Jason have the following descriptions:
InvalidClassException: Something is wrong with a class used by
StreamCorruptedException: Control information in the stream is
I think InvalidClassException more suitable for our case, because we
have here the problem with inconsistent state of serialized class, but
not the control information in the stream (invalid stream header,
invalid type code and etc).
On 29.05.2013 6:54, Jason Mehrens wrote:
>>> You can still generate a ISE inside readObject by performing "new XPathException(new Exception()).initCause(null)" in the old code and then reading that in the new patch. In the new code that line would fail fast.
>> So what should the result of this be given that the original exception
>> has an inconsistent state (two 'causes')?
> Maybe catch ISE and throw InvalidObjectException or StreamCorruptedException?
More information about the core-libs-dev