RFR 8009581: Xpathexception does not honor initcause()

Aleksej Efimov 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 
readObject() method.
Exceptions suggested by Jason have the following descriptions:
     InvalidClassException: Something is wrong with a class used by 
serialization.
     StreamCorruptedException: Control information in the stream is 
inconsistent.
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).

Aleksej

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?
>
> Jason 		 	   		




More information about the core-libs-dev mailing list