Skip to content

Commit

Permalink
Changes wrt [core#1378]
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 3, 2025
1 parent 09416da commit ab2161e
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ReadableInstant deserialize(JsonParser p, DeserializationContext ctxt)
case JsonTokenId.ID_NUMBER_INT:
return _fromTimestamp(ctxt, p.getLongValue());
case JsonTokenId.ID_STRING:
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
case JsonTokenId.ID_START_OBJECT:
// 30-Sep-2020, tatu: New! "Scalar from Object" (mostly for XML)
return _fromString(p, ctxt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public DateTimeZone deserialize(JsonParser p, DeserializationContext ctxt)
// for fun let's allow use of offsets...
return _fromOffset(ctxt, p.getIntValue());
case JsonTokenId.ID_STRING:
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
case JsonTokenId.ID_START_OBJECT:
// 30-Sep-2020, tatu: New! "Scalar from Object" (mostly for XML)
return _fromString(p, ctxt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Duration deserialize(JsonParser p, DeserializationContext ctxt)
case JsonTokenId.ID_NUMBER_INT: // assume it's millisecond count
return _fromTimestamp(ctxt, p.getLongValue());
case JsonTokenId.ID_STRING:
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
case JsonTokenId.ID_START_OBJECT:
// 30-Sep-2020, tatu: New! "Scalar from Object" (mostly for XML)
return _fromString(p, ctxt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Instant deserialize(JsonParser p, DeserializationContext ctxt)
case JsonTokenId.ID_NUMBER_INT:
return _fromTimestamp(ctxt, p.getLongValue());
case JsonTokenId.ID_STRING:
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
case JsonTokenId.ID_START_OBJECT:
// 30-Sep-2020, tatu: New! "Scalar from Object" (mostly for XML)
return _fromString(p, ctxt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public Interval deserialize(JsonParser p, DeserializationContext ctxt)
throws JacksonException
{
if (p.hasToken(JsonToken.VALUE_STRING)) {
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
}
// 30-Sep-2020, tatu: New! "Scalar from Object" (mostly for XML)
if (p.isExpectedStartObjectToken()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public LocalDate deserialize(JsonParser p, DeserializationContext ctxt)
case JsonTokenId.ID_NUMBER_INT:
return _fromTimestamp(ctxt, p.getLongValue());
case JsonTokenId.ID_STRING:
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
case JsonTokenId.ID_START_OBJECT:
return _fromString(p, ctxt,
ctxt.extractScalarFromObject(p, this, handledType()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt)
case JsonTokenId.ID_NUMBER_INT:
return _fromTimestamp(ctxt, p.getLongValue());
case JsonTokenId.ID_STRING:
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
case JsonTokenId.ID_START_OBJECT:
return _fromString(p, ctxt,
ctxt.extractScalarFromObject(p, this, handledType()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public LocalTime deserialize(JsonParser p, DeserializationContext ctxt)
case JsonTokenId.ID_NUMBER_INT:
return new LocalTime(p.getLongValue());
case JsonTokenId.ID_STRING:
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
case JsonTokenId.ID_START_OBJECT:
return _fromString(p, ctxt,
ctxt.extractScalarFromObject(p, this, handledType()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public MonthDay deserialize(final JsonParser p, final DeserializationContext ctx
throws JacksonException
{
if (p.hasToken(JsonToken.VALUE_STRING)) {
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
}
// 30-Sep-2020, tatu: New! "Scalar from Object" (mostly for XML)
if (p.isExpectedStartObjectToken()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public ReadablePeriod deserialize(JsonParser p, DeserializationContext ctxt)
{
JsonToken t = p.currentToken();
if (t == JsonToken.VALUE_STRING) {
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
}
if (t == JsonToken.VALUE_NUMBER_INT) {
return new Period(p.getLongValue());
Expand Down Expand Up @@ -73,8 +73,8 @@ protected ReadablePeriod _fromObject(final JsonParser p, final DeserializationCo
// if we ever hit that.

JsonNode treeNode = p.readValueAsTree();
String periodType = treeNode.path("fieldType").path("name").asText();
String periodName = treeNode.path("periodType").path("name").asText();
String periodType = treeNode.path("fieldType").path("name").asString();
String periodName = treeNode.path("periodType").path("name").asString();
// any "weird" numbers we should worry about?
int periodValue = treeNode.path(periodType).asInt();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public YearMonth deserialize(final JsonParser p, final DeserializationContext ct
throws JacksonException
{
if (p.hasToken(JsonToken.VALUE_STRING)) {
return _fromString(p, ctxt, p.getText());
return _fromString(p, ctxt, p.getString());
}
// 30-Sep-2020, tatu: New! "Scalar from Object" (mostly for XML)
if (p.isExpectedStartObjectToken()) {
Expand Down

0 comments on commit ab2161e

Please sign in to comment.