1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00
This commit is contained in:
Douglas Crockford 2012-11-13 14:26:15 -08:00
parent 71c7539dd3
commit 216a4299f3

View file

@ -77,7 +77,7 @@ import java.util.Map;
* </ul>
*
* @author JSON.org
* @version 2012-04-20
* @version 2012-11-13
*/
public class JSONArray {
@ -556,8 +556,8 @@ public class JSONArray {
public String optString(int index, String defaultValue) {
Object object = this.opt(index);
return JSONObject.NULL.equals(object)
? defaultValue : object
.toString();
? defaultValue
: object.toString();
}
@ -816,7 +816,7 @@ public class JSONArray {
*/
public String toString() {
try {
return '[' + this.join(",") + ']';
return this.toString(0);
} catch (Exception e) {
return null;
}