Skip to content

Commit

Permalink
Update release notes wrt #3566
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 1, 2023
1 parent 3aa2de1 commit d03e6b5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
27 changes: 15 additions & 12 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -1543,26 +1543,29 @@ Gili Tzabari (cowwoc@github)
Joo Hyuk Kim (JooHyukKim@github)
* Contributed #2536: Add `EnumFeature.READ_ENUM_KEYS_USING_INDEX` to work with
existing "WRITE_ENUM_KEYS_USING_INDEX"
(2.15.0)
existing "WRITE_ENUM_KEYS_USING_INDEX"
(2.15.0)
* Contributed #2667: Add `@EnumNaming`, `EnumNamingStrategy` to allow use of naming
strategies for Enums
(2.15.0)
strategies for Enums
(2.15.0)
* Contributed fix for #2968: Deserialization of `@JsonTypeInfo` annotated type fails with
missing type id even for explicit concrete subtypes
(2.15.0)
missing type id even for explicit concrete subtypes
(2.15.0)
* Contributed #3053: Allow serializing enums to lowercase (`EnumFeature.WRITE_ENUMS_TO_LOWERCASE`)
(2.15.0)
(2.15.0)
* Contributed #3566: Cannot use both `JsonCreator.Mode.DELEGATING` and `JsonCreator.Mode.PROPERTIES`
static creator factory methods for Enums
(2.15.0)
* Contributed #3638: Case-insensitive and number-based enum deserialization are
(unnecessarily) mutually exclusive
(2.15.0)
(unnecessarily) mutually exclusive
(2.15.0)
* Contributed #3819: Add convenience method `SimpleBeanPropertyFilter.filterOutAll()` as
counterpart of `serializeAll()`
(2.15.0)
counterpart of `serializeAll()`
(2.15.0)
Vojtěch Knyttl (knyttl@github)
* Requested #3053: Allow serializing enums to lowercase (`EnumFeature.WRITE_ENUMS_TO_LOWERCASE`)
(2.15.0)
(2.15.0)
Phil Gref (pgrefviau@github)
* Reported #3638: Case-insensitive and number-based enum deserialization are
Expand Down
4 changes: 4 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ Project: jackson-databind

Not yet released

#3566: Cannot use both `JsonCreator.Mode.DELEGATING` and `JsonCreator.Mode.PROPERTIES`
static creator factory methods for Enums
(reported by @andrewbents)
#3836: `Optional<Boolean>` is not recognized as boolean field
(reported by @thnaeff)
(fix contributed by Joo-Hyuk K)

2.15.0-rc2 (28-Mar-2023)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ class FactoryBasedEnumDeserializer

/**
* Lazily instantiated property-based creator.
* Introduced in 2.8 and wrapped with {@link AtomicReference} in 2.15
*
* @since 2.15
*
* @since 2.8
*/
private AtomicReference<PropertyBasedCreator> _propCreatorRef = new AtomicReference<>(null);
private transient volatile PropertyBasedCreator _propCreator;

public FactoryBasedEnumDeserializer(Class<?> cls, AnnotatedMethod f, JavaType paramType,
ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps)
Expand Down Expand Up @@ -136,13 +134,14 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
// 2.11, was just assuming match)
if (_creatorProps != null) {
if (p.isExpectedStartObjectToken()) {
if (_propCreatorRef.get() == null) {
_propCreatorRef.compareAndSet(null,
PropertyBasedCreator.construct(ctxt, _valueInstantiator, _creatorProps,
ctxt.isEnabled(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)));
PropertyBasedCreator pc = _propCreator;
if (pc == null) {
_propCreator = pc = PropertyBasedCreator.construct(ctxt,
_valueInstantiator, _creatorProps,
ctxt.isEnabled(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES));
}
p.nextToken();
return deserializeEnumUsingPropertyBased(p, ctxt, _propCreatorRef.get());
return deserializeEnumUsingPropertyBased(p, ctxt, pc);
}
// If value cannot possibly be delegating-creator,
if (!_valueInstantiator.canCreateFromString()) {
Expand Down

0 comments on commit d03e6b5

Please sign in to comment.