return jsonString.stringValue();
}
+ public static Double getAsDouble(JSONValue jsonValue) {
+ if (jsonValue == null) {
+ return null;
+ }
+ JSONNumber jsonNumber;
+ if ((jsonNumber = jsonValue.isNumber()) == null) {
+ JSONString jsonString = jsonValue.isString();
+ return jsonString != null ? Double.parseDouble(jsonString.toString()) : null;
+ }
+ return jsonNumber.doubleValue();
+ }
+
/**
* @since 2.5
*/
for (int i = 0; i < size; i++) {
JSONObject cellJson = JsonUtils.getArray(cells, i);
JSONArray valuesJson = cellJson.get("v").isArray();
- Object[] resultValues = new Object[valuesJson.size()];
+ Object[] resultValues = new Object[JsonUtils.getArraySize(valuesJson)];
for (int indexValue = 0; indexValue < JsonUtils.getArraySize(valuesJson); indexValue++) {
Object value = valuesJson.get(indexValue);
resultValues[indexValue] = value;