mirror of
https://github.com/stleary/JSON-java.git
synced 2026-01-24 00:03:17 -05: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