mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-10 12:34:30 +08:00
backing out recent changes to optLong, getLong. See #868
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user