Fix null handling of EnumSetDeserializer (original) (raw)

Search before asking

Describe the bug

The EnumSetDeserializer implementation has problems with calls to _nullProvider and handling of _skipNullValues that are not consistent.
This Issue was submitted based on the following comment
#5165 (comment)

Version Information

2.20.0

Reproduction

No response

Expected behavior

It is suggested that the flow should be modified as follows

flowchart TD A[Is JsonToken.VALUE_NULL?] -->|Yes| B[Is _skipNullValues true?] B -->|Yes| C[Skip] B -->|No| D[value = _nullProvider.getNullValue]

A -->|No| E[value = _enumDeserializer.deserialize]
E --> F{Is value null?}
F -->|Yes| D
F -->|No| M[Use value]

D --> I{Is value null?}

I -->|Yes| J[Is _skipNullValues true?]
J -->|Yes| K[skip value]
J -->|No| L[Throw error]

I -->|No| M

Loading

Additional context

No response