1
1
package com .fasterxml .jackson .databind .type ;
2
2
3
3
import java .util .ArrayList ;
4
+ import java .util .Arrays ;
4
5
import java .util .List ;
5
6
6
7
import com .fasterxml .jackson .annotation .JsonCreator ;
@@ -16,7 +17,6 @@ static class Tree<T extends Tree<?>> {
16
17
17
18
final List <T > children ;
18
19
19
- @ SuppressWarnings ("DataFlowIssue" )
20
20
@ JsonCreator (mode = JsonCreator .Mode .DELEGATING )
21
21
public Tree (List <T > children ) {
22
22
if (!children .stream ().allMatch (c -> c instanceof Tree <?>)) {
@@ -64,9 +64,9 @@ public void testRecursiveWildcard() throws Exception
64
64
public void testDeserWildcard4118 () throws Exception
65
65
{
66
66
// Given
67
- TestAttribute4118 a = new TestAttribute4118 (null );
68
- TestAttribute4118 b = new TestAttribute4118 (_listOf (a ));
69
- TestAttribute4118 c = new TestAttribute4118 (_listOf (b ));
67
+ TestAttribute4118 <?> a = new TestAttribute4118 <> (null );
68
+ TestAttribute4118 <?> b = new TestAttribute4118 <> (_listOf (a ));
69
+ TestAttribute4118 <?> c = new TestAttribute4118 <> (_listOf (b ));
70
70
TestObject4118 test = new TestObject4118 (_listOf (c ));
71
71
72
72
String serialized = MAPPER .writeValueAsString (test );
@@ -79,8 +79,6 @@ public void testDeserWildcard4118() throws Exception
79
79
}
80
80
81
81
private <T > List <T > _listOf (T elem ) {
82
- ArrayList <T > list = new ArrayList <>();
83
- list .add (elem );
84
- return list ;
82
+ return Arrays .asList (elem );
85
83
}
86
84
}
0 commit comments