Skip to content

Commit

Permalink
Merge branch '2.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 14, 2020
2 parents 33b2718 + 22d9595 commit 75bc339
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AtomicBoolean deserialize(JsonParser p, DeserializationContext ctxt) thro
}
// 12-Jun-2020, tatu: May look convoluted, but need to work correctly with
// CoercionConfig
Boolean b = _parseBoolean(ctxt, p, AtomicBoolean.class);
Boolean b = _parseBoolean(p, ctxt, AtomicBoolean.class);
return (b == null) ? null : new AtomicBoolean(b.booleanValue());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ public Boolean deserialize(JsonParser p, DeserializationContext ctxt) throws IOE
return Boolean.FALSE;
}
if (_primitive) {
return _parseBooleanPrimitive(ctxt, p);
return _parseBooleanPrimitive(p, ctxt);
}
return _parseBoolean(ctxt, p, _valueClass);
return _parseBoolean(p, ctxt, _valueClass);
}

// Since we can never have type info ("natural type"; String, Boolean, Integer, Double):
Expand All @@ -229,9 +229,9 @@ public Boolean deserializeWithType(JsonParser p, DeserializationContext ctxt,
return Boolean.FALSE;
}
if (_primitive) {
return _parseBooleanPrimitive(ctxt, p);
return _parseBooleanPrimitive(p, ctxt);
}
return _parseBoolean(ctxt, p, _valueClass);
return _parseBoolean(p, ctxt, _valueClass);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public boolean[] deserialize(JsonParser p, DeserializationContext ctxt)
_verifyNullForPrimitive(ctxt);
value = false;
} else {
value = _parseBooleanPrimitive(ctxt, p);
value = _parseBooleanPrimitive(p, ctxt);
}
if (ix >= chunk.length) {
chunk = builder.appendCompletedChunk(chunk, ix);
Expand All @@ -395,7 +395,7 @@ public boolean[] deserialize(JsonParser p, DeserializationContext ctxt)
@Override
protected boolean[] handleSingleElementUnwrapped(JsonParser p,
DeserializationContext ctxt) throws IOException {
return new boolean[] { _parseBooleanPrimitive(ctxt, p) };
return new boolean[] { _parseBooleanPrimitive(p, ctxt) };
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,8 @@ protected T _deserializeWrappedValue(JsonParser p, DeserializationContext ctxt)
* (may be {@code boolean[]} or {@code AtomicBoolean} for example);
* used for coercion config access
*/
protected final boolean _parseBooleanPrimitive(DeserializationContext ctxt,
JsonParser p)
throws IOException
protected final boolean _parseBooleanPrimitive(JsonParser p, DeserializationContext ctxt)
throws IOException
{
final JsonToken t = p.currentToken();
// usually caller should have handled but:
Expand Down Expand Up @@ -360,7 +359,7 @@ protected final boolean _parseBooleanPrimitive(DeserializationContext ctxt,
// 12-Jun-2020, tatu: For some reason calling `_deserializeFromArray()` won't work so:
if (t == JsonToken.START_ARRAY && ctxt.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) {
p.nextToken();
final boolean parsed = _parseBooleanPrimitive(ctxt, p);
final boolean parsed = _parseBooleanPrimitive(p, ctxt);
_verifyEndArrayForSingle(p, ctxt);
return parsed;
}
Expand All @@ -377,16 +376,16 @@ protected final boolean _parseBooleanPrimitive(DeserializationContext ctxt,
* Caller may need to translate from 3 possible result types into appropriately
* matching output types.
*
* @param ctxt Deserialization context for accessing configuration
* @param p Underlying parser
* @param ctxt Deserialization context for accessing configuration
* @param targetType Actual type that is being deserialized, may be
* same as {@link #handledType} but could be {@code AtomicBoolean} for example.
* Used for coercion config access.
*
* @since 2.12
*/
protected final Boolean _parseBoolean(DeserializationContext ctxt,
JsonParser p, Class<?> targetType)
protected final Boolean _parseBoolean(JsonParser p, DeserializationContext ctxt,
Class<?> targetType)
throws IOException
{
switch (p.currentTokenId()) {
Expand Down

0 comments on commit 75bc339

Please sign in to comment.