Skip to content

Commit

Permalink
more refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 14, 2020
1 parent 22d9595 commit d0d5656
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ public Byte deserialize(JsonParser p, DeserializationContext ctxt) throws IOExce
return p.getByteValue();
}
if (_primitive) {
return _parseBytePrimitive(ctxt, p);
return _parseBytePrimitive(p, ctxt);
}
return _parseByte(ctxt, p);
return _parseByte(p, ctxt);
}

protected Byte _parseByte(DeserializationContext ctxt, JsonParser p)
protected Byte _parseByte(JsonParser p, DeserializationContext ctxt)
throws IOException
{
CoercionAction act;
Expand Down Expand Up @@ -306,7 +306,7 @@ protected Byte _parseByte(DeserializationContext ctxt, JsonParser p)
}
return Byte.valueOf((byte) value);
case JsonTokenId.ID_NUMBER_FLOAT:
act = _checkFloatToIntCoercion(ctxt, p, _valueClass);
act = _checkFloatToIntCoercion(p, ctxt, _valueClass);
if (act == CoercionAction.AsNull) {
return (Byte) getNullValue(ctxt);
}
Expand Down Expand Up @@ -347,7 +347,7 @@ public Short deserialize(JsonParser p, DeserializationContext ctxt)
return p.getShortValue();
}
if (_primitive) {
return _parseShortPrimitive(ctxt, p);
return _parseShortPrimitive(p, ctxt);
}
return _parseShort(ctxt, p);
}
Expand Down Expand Up @@ -384,7 +384,7 @@ protected Short _parseShort(DeserializationContext ctxt, JsonParser p)
}
return (short) value;
case JsonTokenId.ID_NUMBER_FLOAT:
act = _checkFloatToIntCoercion(ctxt, p, _valueClass);
act = _checkFloatToIntCoercion(p, ctxt, _valueClass);
if (act == CoercionAction.AsNull) {
return (Short) getNullValue(ctxt);
}
Expand Down Expand Up @@ -490,7 +490,7 @@ public Integer deserialize(JsonParser p, DeserializationContext ctxt) throws IOE
return p.getIntValue();
}
if (_primitive) {
return _parseIntPrimitive(ctxt, p);
return _parseIntPrimitive(p, ctxt);
}
return _parseInteger(ctxt, p);
}
Expand All @@ -505,7 +505,7 @@ public Integer deserializeWithType(JsonParser p, DeserializationContext ctxt,
return p.getIntValue();
}
if (_primitive) {
return _parseIntPrimitive(ctxt, p);
return _parseIntPrimitive(p, ctxt);
}
return _parseInteger(ctxt, p);
}
Expand Down Expand Up @@ -546,7 +546,7 @@ protected final Integer _parseInteger(DeserializationContext ctxt, JsonParser p)
"not a valid Integer value");
}
case JsonTokenId.ID_NUMBER_FLOAT: // coercing may work too
act = _checkFloatToIntCoercion(ctxt, p, _valueClass);
act = _checkFloatToIntCoercion(p, ctxt, _valueClass);
if (act == CoercionAction.AsNull) {
return (Integer) getNullValue(ctxt);
}
Expand Down Expand Up @@ -588,7 +588,7 @@ public Long deserialize(JsonParser p, DeserializationContext ctxt) throws IOExce
return p.getLongValue();
}
if (_primitive) {
return _parseLongPrimitive(ctxt, p);
return _parseLongPrimitive(p, ctxt);
}
return _parseLong(ctxt, p);
}
Expand Down Expand Up @@ -619,7 +619,7 @@ protected final Long _parseLong(DeserializationContext ctxt, JsonParser p)
return (Long) ctxt.handleWeirdStringValue(_valueClass, text,
"not a valid Long value");
case JsonTokenId.ID_NUMBER_FLOAT:
act = _checkFloatToIntCoercion(ctxt, p, _valueClass);
act = _checkFloatToIntCoercion(p, ctxt, _valueClass);
if (act == CoercionAction.AsNull) {
return (Long) getNullValue(ctxt);
}
Expand Down Expand Up @@ -659,7 +659,7 @@ public Float deserialize(JsonParser p, DeserializationContext ctxt) throws IOExc
return p.getFloatValue();
}
if (_primitive) {
return _parseFloatPrimitive(ctxt, p);
return _parseFloatPrimitive(p, ctxt);
}
return _parseFloat(p, ctxt);
}
Expand Down Expand Up @@ -736,7 +736,7 @@ public Double deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
return p.getDoubleValue();
}
if (_primitive) {
return _parseDoublePrimitive(ctxt, p);
return _parseDoublePrimitive(p, ctxt);
}
return _parseDouble(p, ctxt);
}
Expand All @@ -751,7 +751,7 @@ public Double deserializeWithType(JsonParser p, DeserializationContext ctxt,
return p.getDoubleValue();
}
if (_primitive) {
return _parseDoublePrimitive(ctxt, p);
return _parseDoublePrimitive(p, ctxt);
}
return _parseDouble(p, ctxt);
}
Expand Down Expand Up @@ -973,7 +973,7 @@ public BigInteger deserialize(JsonParser p, DeserializationContext ctxt) throws
}
break;
case JsonTokenId.ID_NUMBER_FLOAT:
act = _checkFloatToIntCoercion(ctxt, p, _valueClass);
act = _checkFloatToIntCoercion(p, ctxt, _valueClass);
if (act == CoercionAction.AsNull) {
return (BigInteger) getNullValue(ctxt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public byte[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
_verifyNullForPrimitive(ctxt);
value = (byte) 0;
} else {
value = _parseBytePrimitive(ctxt, p);
value = _parseBytePrimitive(p, ctxt);
}
}
if (ix >= chunk.length) {
Expand Down Expand Up @@ -600,7 +600,7 @@ public short[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOE
_verifyNullForPrimitive(ctxt);
value = (short) 0;
} else {
value = _parseShortPrimitive(ctxt, p);
value = _parseShortPrimitive(p, ctxt);
}
if (ix >= chunk.length) {
chunk = builder.appendCompletedChunk(chunk, ix);
Expand All @@ -617,7 +617,7 @@ public short[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOE
@Override
protected short[] handleSingleElementUnwrapped(JsonParser p,
DeserializationContext ctxt) throws IOException {
return new short[] { _parseShortPrimitive(ctxt, p) };
return new short[] { _parseShortPrimitive(p, ctxt) };
}

@Override
Expand Down Expand Up @@ -678,7 +678,7 @@ public int[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOExc
_verifyNullForPrimitive(ctxt);
value = 0;
} else {
value = _parseIntPrimitive(ctxt, p);
value = _parseIntPrimitive(p, ctxt);
}
if (ix >= chunk.length) {
chunk = builder.appendCompletedChunk(chunk, ix);
Expand All @@ -695,7 +695,7 @@ public int[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOExc
@Override
protected int[] handleSingleElementUnwrapped(JsonParser p,
DeserializationContext ctxt) throws IOException {
return new int[] { _parseIntPrimitive(ctxt, p) };
return new int[] { _parseIntPrimitive(p, ctxt) };
}

@Override
Expand Down Expand Up @@ -756,7 +756,7 @@ public long[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
_verifyNullForPrimitive(ctxt);
value = 0L;
} else {
value = _parseLongPrimitive(ctxt, p);
value = _parseLongPrimitive(p, ctxt);
}
if (ix >= chunk.length) {
chunk = builder.appendCompletedChunk(chunk, ix);
Expand All @@ -773,7 +773,7 @@ public long[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
@Override
protected long[] handleSingleElementUnwrapped(JsonParser p,
DeserializationContext ctxt) throws IOException {
return new long[] { _parseLongPrimitive(ctxt, p) };
return new long[] { _parseLongPrimitive(p, ctxt) };
}

@Override
Expand Down Expand Up @@ -828,7 +828,7 @@ public float[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOE
continue;
}
}
float value = _parseFloatPrimitive(ctxt, p);
float value = _parseFloatPrimitive(p, ctxt);
if (ix >= chunk.length) {
chunk = builder.appendCompletedChunk(chunk, ix);
ix = 0;
Expand All @@ -844,7 +844,7 @@ public float[] deserialize(JsonParser p, DeserializationContext ctxt) throws IOE
@Override
protected float[] handleSingleElementUnwrapped(JsonParser p,
DeserializationContext ctxt) throws IOException {
return new float[] { _parseFloatPrimitive(ctxt, p) };
return new float[] { _parseFloatPrimitive(p, ctxt) };
}

@Override
Expand Down Expand Up @@ -898,7 +898,7 @@ public double[] deserialize(JsonParser p, DeserializationContext ctxt) throws IO
continue;
}
}
double value = _parseDoublePrimitive(ctxt, p);
double value = _parseDoublePrimitive(p, ctxt);
if (ix >= chunk.length) {
chunk = builder.appendCompletedChunk(chunk, ix);
ix = 0;
Expand All @@ -914,7 +914,7 @@ public double[] deserialize(JsonParser p, DeserializationContext ctxt) throws IO
@Override
protected double[] handleSingleElementUnwrapped(JsonParser p,
DeserializationContext ctxt) throws IOException {
return new double[] { _parseDoublePrimitive(ctxt, p) };
return new double[] { _parseDoublePrimitive(p, ctxt) };
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public StackTraceElement deserialize(JsonParser p, DeserializationContext ctxt)
if (t.isNumeric()) {
lineNumber = p.getIntValue();
} else {
lineNumber = _parseIntPrimitive(ctxt, p);
lineNumber = _parseIntPrimitive(p, ctxt);
}
} else if ("methodName".equals(propName)) {
methodName = p.getText();
Expand Down
Loading

0 comments on commit d0d5656

Please sign in to comment.