Skip to content

Commit b11db74

Browse files
committed
Merge branch '2.10'
2 parents ff16128 + 21a33bc commit b11db74

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

release-notes/VERSION-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Project: jackson-databind
1010
#1675: Remove "impossible" `IOException` in `readTree()` and `readValue()` `ObjectMapper`
1111
methods which accept Strings
1212
(requested by matthew-pwnieexpress@github)
13+
#1995: Limit size of `DeserializerCache`, auto-flush on exceeding
1314
#2059: Remove `final` modifier for `TypeFactory`
1415
(requested by Thibaut R)
1516
#2115: Support naive deserialization of `Serializable` values as "untyped", same
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.fasterxml.jackson.failing;
2+
3+
import java.io.Serializable;
4+
import java.util.ArrayList;
5+
import java.util.List;
6+
7+
import com.fasterxml.jackson.databind.*;
8+
9+
// [databind#2331]
10+
public class GenericNestedType2331Test extends BaseMapTest
11+
{
12+
static class SuperNode<T> { }
13+
static class SuperTestClass { }
14+
15+
static class Node<T extends SuperTestClass & Cloneable> extends SuperNode<Node<T>> implements Serializable {
16+
17+
public List<Node<T>> children;
18+
19+
public Node() {
20+
children = new ArrayList<Node<T>>();
21+
}
22+
23+
/**
24+
* The Wildcard here seems to be the Issue.
25+
* If we remove this full getter, everything is working as expected.
26+
* @return
27+
*/
28+
public List<? extends SuperNode<Node<T>>> getChildren() {
29+
return children;
30+
}
31+
}
32+
33+
public void testGeneric2331() throws Exception {
34+
Node root = new Node();
35+
root.children.add(new Node());
36+
37+
String json = newObjectMapper().writeValueAsString(root);
38+
assertNotNull(json);
39+
}
40+
}

0 commit comments

Comments
 (0)