Skip to content

Commit

Permalink
Complete undo of context/parser signature changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 14, 2020
1 parent d0d5656 commit 3d5156b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public Object deserializeWithType(JsonParser p, DeserializationContext ctxt,
t = p.nextToken();
}
if ((t == JsonToken.FIELD_NAME) && _objectIdReader.maySerializeAsObject()
&& _objectIdReader.isValidReferencePropertyName(p.getCurrentName(), p)) {
&& _objectIdReader.isValidReferencePropertyName(p.currentName(), p)) {
return _deserializeFromObjectId(p, ctxt);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ public Short deserialize(JsonParser p, DeserializationContext ctxt)
if (_primitive) {
return _parseShortPrimitive(p, ctxt);
}
return _parseShort(ctxt, p);
return _parseShort(p, ctxt);
}

protected Short _parseShort(DeserializationContext ctxt, JsonParser p)
protected Short _parseShort(JsonParser p, DeserializationContext ctxt)
throws IOException
{
CoercionAction act;
Expand Down Expand Up @@ -492,7 +492,7 @@ public Integer deserialize(JsonParser p, DeserializationContext ctxt) throws IOE
if (_primitive) {
return _parseIntPrimitive(p, ctxt);
}
return _parseInteger(ctxt, p);
return _parseInteger(p, ctxt);
}

// Since we can never have type info ("natural type"; String, Boolean, Integer, Double):
Expand All @@ -507,11 +507,10 @@ public Integer deserializeWithType(JsonParser p, DeserializationContext ctxt,
if (_primitive) {
return _parseIntPrimitive(p, ctxt);
}
return _parseInteger(ctxt, p);
return _parseInteger(p, ctxt);
}

// @since 2.12
protected final Integer _parseInteger(DeserializationContext ctxt, JsonParser p)
protected final Integer _parseInteger(JsonParser p, DeserializationContext ctxt)
throws IOException
{
CoercionAction act;
Expand Down Expand Up @@ -590,11 +589,10 @@ public Long deserialize(JsonParser p, DeserializationContext ctxt) throws IOExce
if (_primitive) {
return _parseLongPrimitive(p, ctxt);
}
return _parseLong(ctxt, p);
return _parseLong(p, ctxt);
}

// @since 2.12
protected final Long _parseLong(DeserializationContext ctxt, JsonParser p)
protected final Long _parseLong(JsonParser p, DeserializationContext ctxt)
throws IOException
{
CoercionAction act;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public StackTraceElement deserialize(JsonParser p, DeserializationContext ctxt)
int lineNumber = -1;

while ((t = p.nextValue()) != JsonToken.END_OBJECT) {
String propName = p.getCurrentName();
String propName = p.currentName();
// TODO: with Java 8, convert to switch
if ("className".equals(propName)) {
className = p.getText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ protected final boolean _parseBooleanPrimitive(JsonParser p, DeserializationCont

// may accept ints too, (0 == false, otherwise true)
if (t == JsonToken.VALUE_NUMBER_INT) {
Boolean b = _coerceBooleanFromInt(ctxt, p, Boolean.TYPE);
Boolean b = _coerceBooleanFromInt(p, ctxt, Boolean.TYPE);
// may get `null`, Boolean.TRUE or Boolean.FALSE so:
return (b == Boolean.TRUE);
}
Expand Down Expand Up @@ -478,7 +478,7 @@ protected final Boolean _parseBoolean(JsonParser p, DeserializationContext ctxt,
return null;
case JsonTokenId.ID_NUMBER_INT:
// may accept ints too, (0 == false, otherwise true)
return _coerceBooleanFromInt(ctxt, p, targetType);
return _coerceBooleanFromInt(p, ctxt, targetType);
case JsonTokenId.ID_START_ARRAY: // unwrapping / from-empty-array coercion?
return (Boolean) _deserializeFromArray(p, ctxt);
}
Expand Down Expand Up @@ -1102,7 +1102,7 @@ protected CoercionAction _checkFloatToIntCoercion(JsonParser p, DeserializationC
/**
* @since 2.12
*/
protected Boolean _coerceBooleanFromInt(DeserializationContext ctxt, JsonParser p,
protected Boolean _coerceBooleanFromInt(JsonParser p, DeserializationContext ctxt,
Class<?> rawTargetType)
throws IOException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) t
int pendingIx = 0;

for (; !p.hasToken(JsonToken.END_OBJECT); p.nextToken()) {
String propName = p.getCurrentName();
String propName = p.currentName();
SettableBeanProperty prop = _beanProperties.find(propName);
p.nextToken(); // to point to field value

Expand Down

0 comments on commit 3d5156b

Please sign in to comment.