@@ -92,15 +92,19 @@ public Map<String,Object> deserialize(JsonParser jp, DeserializationContext ctxt
92
92
}
93
93
}
94
94
95
- static class Untyped989 {
95
+ static class DelegatingUntyped {
96
96
protected Object value ;
97
97
98
98
@ JsonCreator // delegating
99
- public Untyped989 (Object v ) {
99
+ public DelegatingUntyped (Object v ) {
100
100
value = v ;
101
101
}
102
102
}
103
-
103
+
104
+ static class WrappedUntyped1460 {
105
+ public Object value ;
106
+ }
107
+
104
108
/*
105
109
/**********************************************************
106
110
/* Test methods
@@ -253,8 +257,8 @@ public void testUntypedWithMapDeser() throws IOException
253
257
254
258
public void testNestedUntyped989 () throws IOException
255
259
{
256
- Untyped989 pojo ;
257
- ObjectReader r = MAPPER .readerFor (Untyped989 .class );
260
+ DelegatingUntyped pojo ;
261
+ ObjectReader r = MAPPER .readerFor (DelegatingUntyped .class );
258
262
259
263
pojo = r .readValue ("[]" );
260
264
assertTrue (pojo .value instanceof List );
@@ -278,4 +282,17 @@ public void testUntypedWithJsonArrays() throws Exception
278
282
ob = MAPPER .readValue ("[1]" , Object .class );
279
283
assertEquals (Object [].class , ob .getClass ());
280
284
}
285
+
286
+ public void testUntypedIntAsLong () throws Exception
287
+ {
288
+ final String JSON = aposToQuotes ("{'value':3}" );
289
+ WrappedUntyped1460 w = MAPPER .readerFor (WrappedUntyped1460 .class )
290
+ .readValue (JSON );
291
+ assertEquals (Integer .valueOf (3 ), w .value );
292
+
293
+ w = MAPPER .readerFor (WrappedUntyped1460 .class )
294
+ .with (DeserializationFeature .USE_LONG_FOR_INTS )
295
+ .readValue (JSON );
296
+ assertEquals (Long .valueOf (3 ), w .value );
297
+ }
281
298
}
0 commit comments