Skip to content

StringCollectionDeserializer fails with custom collection #2324

@dbarvitsky

Description

@dbarvitsky

Seeing this with Jackson 2.9.8.

We have a custom collection implementation, which is wired to use its "immutable" version for deserialization. The rationale is that we don't want accidental modifications to the data structures that come from the wire, so they all are forced to be immutable.

After upgrade from 2.6.3 to 2.9.8, the deserialization started breaking with the message:

Cannot construct instance of XXX (although at least one Creator exists): no default no-arguments constructor found

This happens ONLY when you deserialize a custom collection of strings as a property of the other object. Deserializing the custom collection of strings directly works fine, and so does the deserialization of custom collection of non-strings. I believe either the StringCollectionDeserializer should not be invoked for custom collections, or perhaps it does not handle the delegation as expected.

Please see comments for repro and workaround.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions