Skip to content

Collection deserialization does not invoke property initializer #509

Closed
@kdkeck

Description

@kdkeck

I have a class in which I want one of the properties to hold a SortedSet in reverse order. I naively thought the following code would accomplish this:

public class Foo {
  @Id private ObjectId id;
  @JsonProperty private final SortedSet<String> reverseSortedSet =
      new TreeSet<>(Collections.reverseOrder());
}

But it does not. Instead, upon deserialization, foo.getReverseSortedSet().comparator() returns null.

Would making this work as one would expect be too much to ask?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions