diff --git a/JSONArray.java b/JSONArray.java index 71c277a..b5a2dd4 100644 --- a/JSONArray.java +++ b/JSONArray.java @@ -77,7 +77,7 @@ import java.util.Map; * * * @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; }