Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 8, 2020
1 parent 00d7356 commit 2a6a960
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ protected DeserializationContext(DeserializationContext src,
{
_cache = src._cache;
_factory = src._factory;
_readCapabilities = p.getReadCapabilities();

// 08-Jun-2020. tatu: Called only for `ObjectMapper.canDeserialize()`
// (see [databind#2749]), not sure what's the best work-around but
// start with this:
_readCapabilities = (p == null) ? null : p.getReadCapabilities();

_config = config;
_featureFlags = config.getDeserializationFeatures();
_view = config.getActiveView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3324,7 +3324,7 @@ public boolean canDeserialize(JavaType type, AtomicReference<Throwable> cause)
return createDeserializationContext(null,
getDeserializationConfig()).hasValueDeserializerFor(type, cause);
}

/*
/**********************************************************
/* Extended Public API, deserialization,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ public void testConfigForPropertySorting() throws Exception
assertTrue(dc.shouldSortPropertiesAlphabetically());
}


public void testJsonFactoryLinkage()
{
// first, implicit factory, giving implicit linkage
Expand Down Expand Up @@ -342,6 +341,13 @@ public void testEmptyBeanSerializability()
.canSerialize(EmptyBean.class));
}

// for [databind#2749]: just to check there's no NPE; method really not useful
public void testCanDeserialize()
{
assertTrue(MAPPER.canDeserialize(MAPPER.constructType(EmptyBean.class)));
assertTrue(MAPPER.canDeserialize(MAPPER.constructType(Object.class)));
}

// for [databind#898]
public void testSerializerProviderAccess() throws Exception
{
Expand Down

0 comments on commit 2a6a960

Please sign in to comment.