Skip to content

Commit

Permalink
Fix wrt [core#1378]
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 3, 2025
1 parent 7aba50b commit 260557a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private EnumJsonCreatorReader(Class<?> valueType, Method jsonCreatorMethod) {
public Object read(JSONReader reader, JsonParser p) throws JacksonException
{
try {
return _jsonCreatorMethod.invoke(_valueType, p.getText());
return _jsonCreatorMethod.invoke(_valueType, p.getString());
} catch (Exception e) {
throw new JSONObjectException("Cannot call JsonCreator method", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public LocalDateTimeValueReader(DateTimeFormatter formatter) {

@Override
public Object read(JSONReader reader, JsonParser p) throws JacksonException {
return LocalDateTime.parse(p.getText(), formatter);
return LocalDateTime.parse(p.getString(), formatter);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Object readNext(JSONReader r, JsonParser p) throws JacksonException
}
return readArrayFromArray(r, p, r._collectionBuilder);
case ID_STRING:
return fromString(p.getText());
return fromString(p.getString());
case ID_NUMBER_INT:
{
NumberType n = p.getNumberType();
Expand Down Expand Up @@ -97,7 +97,7 @@ public Object read(JSONReader r, JsonParser p) throws JacksonException
}
return readArrayFromArray(r, p, r._collectionBuilder);
case ID_STRING:
return fromString(p.getText());
return fromString(p.getString());
case ID_NUMBER_INT:
{
NumberType n = p.getNumberType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public Object read(JSONReader r, JsonParser p) throws JacksonException
case JsonTokenId.ID_NULL:
return null;
case JsonTokenId.ID_STRING:
return _constructors.create(p.getText());
return _constructors.create(p.getString());
case JsonTokenId.ID_NUMBER_INT:
return _constructors.create(p.getLongValue());
default:
Expand Down Expand Up @@ -191,7 +191,7 @@ public Object readNext(JSONReader r, JsonParser p) throws JacksonException
case VALUE_NULL:
return null;
case VALUE_STRING:
return _constructors.create(p.getText());
return _constructors.create(p.getString());
case VALUE_NUMBER_INT:
return _constructors.create(p.getLongValue());
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private String desc() {

@Override
public Object readNext(JSONReader reader, JsonParser p) throws JacksonException {
String name = p.nextTextValue();
String name = p.nextStringValue();
if (name != null) {
return _enum(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Object readNext(JSONReader reader, JsonParser p) throws JacksonException
case SER_STRING:
case SER_CHARACTER_SEQUENCE:
{
String str = p.nextTextValue();
String str = p.nextStringValue();
if (str != null) {
return str;
}
Expand All @@ -52,7 +52,7 @@ public Object readNext(JSONReader reader, JsonParser p) throws JacksonException

case SER_CHAR_ARRAY:
{
String str = p.nextTextValue();
String str = p.nextStringValue();
if (str != null) {
return str.toCharArray();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ABCValueReader() {

@Override
public Object read(JSONReader reader, JsonParser p) {
final String str = p.getText();
final String str = p.getString();
if ("n/a".equals(str)) {
return ABC.DEF;
}
Expand All @@ -78,7 +78,7 @@ public CapStringReader() {

@Override
public Object read(JSONReader reader, JsonParser p) {
return p.getText().toUpperCase();
return p.getString().toUpperCase();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void testStringReaderReplacement() throws Exception
new ValueReader(String.class) {
@Override
public Object read(JSONReader reader, JsonParser p) {
return p.getText().toUpperCase();
return p.getString().toUpperCase();
};
});
assertEquals("FOOBAR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private JrsValue nodeFrom(JsonParser p) throws JacksonException
}
return new JrsNumber(p.getNumberValue());
case JsonTokenId.ID_STRING:
return new JrsString(p.getText());
return new JrsString(p.getString());
case JsonTokenId.ID_START_ARRAY: {
List<JrsValue> values = _list();
while (p.nextToken() != JsonToken.END_ARRAY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public TokenStreamLocation currentLocation() {
*/

@Override
public String getText()
public String getString()
{
if (_closed) {
return null;
Expand All @@ -255,22 +255,22 @@ public String getText()
}

@Override
public char[] getTextCharacters() throws JacksonException {
return getText().toCharArray();
public char[] getStringCharacters() throws JacksonException {
return getString().toCharArray();
}

@Override
public int getTextLength() throws JacksonException {
return getText().length();
public int getStringLength() throws JacksonException {
return getString().length();
}

@Override
public int getTextOffset() throws JacksonException {
public int getStringOffset() throws JacksonException {
return 0;
}

@Override
public boolean hasTextCharacters() {
public boolean hasStringCharacters() {
// generally we do not have efficient access as char[], hence:
return false;
}
Expand Down

0 comments on commit 260557a

Please sign in to comment.