@@ -76,10 +76,8 @@ public PotentialCreator findPrimaryCreator(MapperConfig<?> config,
76
76
List <PotentialCreator > declaredFactories )
77
77
{
78
78
if (valueClass .getRawType () != POJO4584 .class ) {
79
- System .err .println ("findCanonicalCreator SKIPPED for: " +valueClass .getRawType ());
80
79
return null ;
81
80
}
82
- System .err .println ("findCanonicalCreator DONE for: " +valueClass .getRawType ());
83
81
List <PotentialCreator > combo = new ArrayList <>(declaredConstructors );
84
82
combo .addAll (declaredFactories );
85
83
final int argCount = _argTypes .length ;
@@ -92,13 +90,11 @@ public PotentialCreator findPrimaryCreator(MapperConfig<?> config,
92
90
}
93
91
}
94
92
if (i == argCount ) {
95
- System .err .println ("MATCH! " +ctor );
96
93
ctor .overrideMode (_mode );
97
94
return ctor ;
98
95
}
99
96
}
100
97
}
101
- System .err .println ("No MATCH! " );
102
98
return null ;
103
99
}
104
100
}
@@ -109,16 +105,25 @@ public PotentialCreator findPrimaryCreator(MapperConfig<?> config,
109
105
/**********************************************************************
110
106
*/
111
107
112
- /*
113
108
@ Test
114
- public void testCanonicalConstructorPropertiesCreator () throws Exception
109
+ public void testCanonicalConstructor1ArgPropertiesCreator () throws Exception
115
110
{
116
- assertEquals(POJO4584.factoryString("List[0]"),
111
+ // Instead of delegating, try denoting List-taking 1-arg one:
112
+ assertEquals (POJO4584 .factoryString ("List[2]" ),
117
113
readerWith (new PrimaryCreatorFindingIntrospector (JsonCreator .Mode .PROPERTIES ,
118
114
List .class ))
119
- .readValue(a2q("{'x':[ ]}")));
115
+ .readValue (a2q ("{'list':[ 1, 2]}" )));
116
+ }
117
+
118
+ @ Test
119
+ public void testCanonicalConstructor2ArgPropertiesCreator () throws Exception
120
+ {
121
+ // Mark the "true" canonical
122
+ assertEquals (POJO4584 .factoryString ("abc" ),
123
+ readerWith (new PrimaryCreatorFindingIntrospector (JsonCreator .Mode .PROPERTIES ,
124
+ String .class , Integer .TYPE ))
125
+ .readValue (a2q ("{'bogus':12, 'v':'abc' }" )));
120
126
}
121
- */
122
127
123
128
/*
124
129
/**********************************************************************
0 commit comments