Skip to content

Commit

Permalink
Update release notes wrt #3505
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Oct 1, 2022
1 parent a5c4632 commit 90aeb43
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -1487,3 +1487,8 @@ Igor Shymko (ancane@github)
Jordi Ortolá Ankum (Tomasito665@github)
* Contributed #3503: `StdDeserializer` coerces ints to floats even if configured to fail
(2.14.0)
Arnaud Solé (Bluexin@github)
* Contributed #3505: Fix deduction deserializer with DefaultTypeResolverBuilder
(2.14.0)
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Project: jackson-databind
(contributed by Igor S)
#3503: `StdDeserializer` coerces ints to floats even if configured to fail
(contributed by Jordi O-A)
#3505: Fix deduction deserializer with DefaultTypeResolverBuilder
(contributed by Arnaud S)
#3528: `TokenBuffer` defaults for parser/stream-read features neither passed
from parser nor use real defaults
#3530: Change LRUMap to just evict one entry when maxEntries reached
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.fasterxml.jackson.databind.deser;
package com.fasterxml.jackson.databind.jsontype.deftyping;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.BaseMapTest;
Expand All @@ -13,11 +13,12 @@
import java.util.Collection;
import java.util.List;

// Tests for [databind#pending] causing a NPE when setting a DefaultTypeResolverBuilder
// Tests for [databind#3505] causing a NPE when setting a DefaultTypeResolverBuilder
// and registering subtypes through ObjectMapper (no annotations)
public class TestDeserializerFactoryWithDefaultTypeResolverBuilder extends BaseMapTest {

private interface Parent {
public class DefaultTypeResolver3505Test
extends BaseMapTest
{
interface Parent {
class ChildOne implements Parent {
public String one;
}
Expand All @@ -30,8 +31,10 @@ class ChildTwo implements Parent {
// This class is technically not needed for the test to fail without the fix
// (AsDeductionTypeDeserializer will crash in #buildFingerprints), but was
// added to have more assertions on the subtypes values
private static final class AssertingTypeResolverBuilder extends ObjectMapper.DefaultTypeResolverBuilder {

@SuppressWarnings("serial")
static final class AssertingTypeResolverBuilder
extends ObjectMapper.DefaultTypeResolverBuilder
{
public AssertingTypeResolverBuilder() {
super(ObjectMapper.DefaultTyping.NON_CONCRETE_AND_ARRAYS,
BasicPolymorphicTypeValidator.builder().allowIfSubType(Parent.class).build());
Expand Down

0 comments on commit 90aeb43

Please sign in to comment.