Skip to content

Commit 388b7dc

Browse files
committed
More warnings removal (3.0-proofing)
1 parent bd7dae5 commit 388b7dc

14 files changed

+50
-31
lines changed

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Project: jackson-databind
66

77
2.17.0 (not yet released)
88

9+
#4160: Deprecate `DefaultTyping.EVERYTHING` in `2.x` and remove in `3.0`
10+
(contributed by Joo-Hyuk K)
911
#4194: Add `JsonNodeFeature.FAIL_ON_NAN_TO_BIG_DECIMAL_COERCION` option to
1012
fail on attempting to coerce `NaN` into `BigDecimal`
1113
(contributed by Joo-Hyuk K)

src/main/java/com/fasterxml/jackson/databind/JsonMappingException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public JsonMappingException(Closeable processor, String msg) {
236236
// 17-Aug-2015, tatu: Use of token location makes some sense from databinding,
237237
// since actual parsing (current) location is typically only needed for low-level
238238
// parsing exceptions.
239-
_location = ((JsonParser) processor).getTokenLocation();
239+
_location = ((JsonParser) processor).currentTokenLocation();
240240
}
241241
}
242242

@@ -250,7 +250,7 @@ public JsonMappingException(Closeable processor, String msg, Throwable problem)
250250
if (problem instanceof JacksonException) {
251251
_location = ((JacksonException) problem).getLocation();
252252
} else if (processor instanceof JsonParser) {
253-
_location = ((JsonParser) processor).getTokenLocation();
253+
_location = ((JsonParser) processor).currentTokenLocation();
254254
}
255255
}
256256

src/main/java/com/fasterxml/jackson/databind/MappingIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public FormatSchema getParserSchema() {
376376
* @since 2.2.1
377377
*/
378378
public JsonLocation getCurrentLocation() {
379-
return _parser.getCurrentLocation();
379+
return _parser.currentLocation();
380380
}
381381

382382
/*

src/main/java/com/fasterxml/jackson/databind/deser/AbstractDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ protected Object _deserializeFromObjectId(JsonParser p, DeserializationContext c
331331
Object pojo = roid.resolve();
332332
if (pojo == null) { // not yet; should wait...
333333
throw new UnresolvedForwardReference(p,
334-
"Could not resolve Object Id ["+id+"] -- unresolved forward-reference?", p.getCurrentLocation(), roid);
334+
"Could not resolve Object Id ["+id+"] -- unresolved forward-reference?", p.currentLocation(), roid);
335335
}
336336
return pojo;
337337
}

src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ protected final Object _deserializeOther(JsonParser p, DeserializationContext ct
233233
public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean) throws IOException
234234
{
235235
// [databind#631]: Assign current value, to be accessible by custom serializers
236-
p.setCurrentValue(bean);
236+
p.assignCurrentValue(bean);
237237
if (_injectables != null) {
238238
injectValues(ctxt, bean);
239239
}
@@ -299,7 +299,7 @@ private final Object vanillaDeserialize(JsonParser p,
299299
if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)) {
300300
// [databind#631]: Assign current value, to be accessible by custom serializers
301301
// [databind#4184]: but only if we have at least one property
302-
p.setCurrentValue(bean);
302+
p.assignCurrentValue(bean);
303303
String propName = p.currentName();
304304
do {
305305
p.nextToken();
@@ -362,7 +362,7 @@ public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) t
362362
}
363363
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
364364
// [databind#631]: Assign current value, to be accessible by custom deserializers
365-
p.setCurrentValue(bean);
365+
p.assignCurrentValue(bean);
366366
if (p.canReadObjectId()) {
367367
Object id = p.getObjectId();
368368
if (id != null) {
@@ -451,7 +451,7 @@ protected Object _deserializeUsingPropertyBased(final JsonParser p, final Deseri
451451
_creatorReturnedNullException());
452452
}
453453
// [databind#631]: Assign current value, to be accessible by custom serializers
454-
p.setCurrentValue(bean);
454+
p.assignCurrentValue(bean);
455455

456456
// polymorphic?
457457
if (bean.getClass() != _beanType.getRawClass()) {
@@ -713,7 +713,7 @@ protected Object deserializeWithUnwrapped(JsonParser p, DeserializationContext c
713713
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
714714

715715
// [databind#631]: Assign current value, to be accessible by custom serializers
716-
p.setCurrentValue(bean);
716+
p.assignCurrentValue(bean);
717717

718718
if (_injectables != null) {
719719
injectValues(ctxt, bean);
@@ -860,7 +860,7 @@ protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p, Deseri
860860
bean = wrapInstantiationProblem(e, ctxt);
861861
}
862862
// [databind#631]: Assign current value, to be accessible by custom serializers
863-
p.setCurrentValue(bean);
863+
p.assignCurrentValue(bean);
864864
// if so, need to copy all remaining tokens into buffer
865865
while (t == JsonToken.FIELD_NAME) {
866866
// NOTE: do NOT skip name as it needs to be copied; `copyCurrentStructure` does that

src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ protected Object deserializeFromObjectId(JsonParser p, DeserializationContext ct
14721472
if (pojo == null) { // not yet; should wait...
14731473
throw new UnresolvedForwardReference(p,
14741474
"Could not resolve Object Id ["+id+"] (for "+_beanType+").",
1475-
p.getCurrentLocation(), roid);
1475+
p.currentLocation(), roid);
14761476
}
14771477
return pojo;
14781478
}

src/main/java/com/fasterxml/jackson/databind/deser/impl/BeanAsArrayDeserializer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt)
109109
}
110110
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
111111
// [databind#631]: Assign current value, to be accessible by custom serializers
112-
p.setCurrentValue(bean);
112+
p.assignCurrentValue(bean);
113113

114114
final SettableBeanProperty[] props = _orderedProperties;
115115
int i = 0;
@@ -152,7 +152,7 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean
152152
throws IOException
153153
{
154154
// [databind#631]: Assign current value, to be accessible by custom serializers
155-
p.setCurrentValue(bean);
155+
p.assignCurrentValue(bean);
156156

157157
if (!p.isExpectedStartArrayToken()) {
158158
return _deserializeFromNonArray(p, ctxt);
@@ -227,7 +227,7 @@ protected Object _deserializeNonVanilla(JsonParser p, DeserializationContext ctx
227227
}
228228
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
229229
// [databind#631]: Assign current value, to be accessible by custom serializers
230-
p.setCurrentValue(bean);
230+
p.assignCurrentValue(bean);
231231
if (_injectables != null) {
232232
injectValues(ctxt, bean);
233233
}
@@ -330,7 +330,7 @@ protected final Object _deserializeUsingPropertyBased(final JsonParser p, final
330330
continue; // never gets here
331331
}
332332
// [databind#631]: Assign current value, to be accessible by custom serializers
333-
p.setCurrentValue(bean);
333+
p.assignCurrentValue(bean);
334334

335335
// polymorphic?
336336
if (bean.getClass() != _beanType.getRawClass()) {

src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ protected Collection<Object> _deserializeFromArray(JsonParser p, Deserialization
338338
throws IOException
339339
{
340340
// [databind#631]: Assign current value, to be accessible by custom serializers
341-
p.setCurrentValue(result);
341+
p.assignCurrentValue(result);
342342

343343
JsonDeserializer<Object> valueDes = _valueDeserializer;
344344
// Let's offline handling of values with Object Ids (simplifies code here)
@@ -433,7 +433,7 @@ protected Collection<Object> _deserializeWithObjectId(JsonParser p, Deserializat
433433
return handleNonArray(p, ctxt, result);
434434
}
435435
// [databind#631]: Assign current value, to be accessible by custom serializers
436-
p.setCurrentValue(result);
436+
p.assignCurrentValue(result);
437437

438438
final JsonDeserializer<Object> valueDes = _valueDeserializer;
439439
final TypeDeserializer typeDeser = _valueTypeDeserializer;

src/main/java/com/fasterxml/jackson/databind/deser/std/EnumMapDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public EnumMap<?,?> deserialize(JsonParser p, DeserializationContext ctxt,
267267
throws IOException
268268
{
269269
// [databind#631]: Assign current value, to be accessible by custom deserializers
270-
p.setCurrentValue(result);
270+
p.assignCurrentValue(result);
271271

272272
final JsonDeserializer<Object> valueDes = _valueDeserializer;
273273
final TypeDeserializer typeDeser = _valueTypeDeserializer;

src/main/java/com/fasterxml/jackson/databind/deser/std/MapDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public Map<Object,Object> deserialize(JsonParser p, DeserializationContext ctxt,
467467
throws IOException
468468
{
469469
// [databind#631]: Assign current value, to be accessible by custom deserializers
470-
p.setCurrentValue(result);
470+
p.assignCurrentValue(result);
471471

472472
// Ok: must point to START_OBJECT or FIELD_NAME
473473
JsonToken t = p.currentToken();

0 commit comments

Comments
 (0)