backing out recent changes to optLong, getLong. See #868

This commit is contained in:
Sean Leary
2024-02-24 13:07:51 -06:00
parent d36066cf82
commit 771c82c4eb
12 changed files with 175 additions and 580 deletions

View File

@@ -360,7 +360,7 @@ public class JSONArray implements Iterable<Object> {
if (object instanceof Number) {
return (Number)object;
}
return NumberConversionUtil.stringToNumber(object.toString());
return JSONObject.stringToNumber(object.toString());
} catch (Exception e) {
throw wrongValueFormatException(index, "number", object, e);
}
@@ -1107,7 +1107,7 @@ public class JSONArray implements Iterable<Object> {
if (val instanceof String) {
try {
return NumberConversionUtil.stringToNumber((String) val);
return JSONObject.stringToNumber((String) val);
} catch (Exception e) {
return defaultValue;
}