Skip to content

Commit

Permalink
Fix #2091
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 6, 2020
1 parent a39892c commit 620d889
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -1110,3 +1110,7 @@ Robin Roos (robinroos@github)
Mike Gilbode (gilbode@github)
* Reported #792: Deserialization Not Working Right with Generic Types and Builders
(2.12.0)

Nate Bauernfeind (nbauernfeind@github)
* Reported #2091: `ReferenceType` does not expose valid containedType
(2.12.0)
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Project: jackson-databind

#792: Deserialization Not Working Right with Generic Types and Builders
(reported by Mike G; fix contributed by Ville K)
#2091: `ReferenceType` does not expose valid containedType
(reported by Nate B)
#2683: Explicitly fail (de)serialization of `java.time.*` types in absence of
registered custom (de)serializers
#2707: Improve description included in by `DeserializationContext.handleUnexpectedToken()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,8 @@ public JavaType constructSimpleType(Class<?> rawType, Class<?> parameterTarget,
*/
public JavaType constructReferenceType(Class<?> rawType, JavaType referredType)
{
return ReferenceType.construct(rawType, null, // no bindings
return ReferenceType.construct(rawType,
TypeBindings.create(rawType, referredType), // [databind#2091]
null, null, // or super-class, interfaces?
referredType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,12 @@ public void testConstructReferenceType() throws Exception
assertTrue(t.hasContentType());
assertEquals(Long.class, t.getContentType().getRawClass());

// 26-Mar-2020, tatu: [databind#2019] suggest this should be 1...
// assertEquals(1, t.containedTypeCount());
// 26-Mar-2020, tatu: [databind#2019] made this work
assertEquals(1, t.containedTypeCount());
TypeBindings bindings = t.getBindings();
assertEquals(1, bindings.size());
assertEquals(refdType, bindings.getBoundType(0));
// Should we even verify this or not?
assertEquals("V", bindings.getBoundName(0));
}
}

0 comments on commit 620d889

Please sign in to comment.