On Wed, 1 May 2024 18:43:21 GMT, Roger Riggs <rri...@openjdk.org> wrote:

> The issue reported a ClassCastException "cannot assign instance of 
> java.util.CollSer to field of type java.util.Map"
> while deserializing an object referring to an immutable Map that contained a 
> reference to a class that was not available.
> Immutable Collections such as Map utilize a serialization proxy in their 
> serialized form.
> During deserialization the serialization proxy (a private implementation 
> class) was attempted to be set in a field resulting in the 
> ClassCastException. The ClassCastException and bug hid the ClassCastException 
> that should have been thrown.
> 
> When reading record fields or fields of a class, the results of 
> deserialization of individual fields are recorded as dependencies of the 
> object being constructed.
> The apparent bug is that the summary of those dependencies is not checked 
> between reading the fields and invoking the constructor to create the record 
> or assigning the fields to an object being constructed.

Thanks for the review.
I have some ideas to refactor readOrdinaryObject to split out the various 
subcases and be able to simplify each one.
That's a separate (future) PR.

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

PR Comment: https://git.openjdk.org/jdk/pull/19043#issuecomment-2118070421

Reply via email to