@@ -111,7 +111,7 @@ private JSONArray(JSONTokener x) {
111111 for (;;) {
112112 if (x .nextClean () == ',' ) {
113113 x .back ();
114- myArrayList .add (JSON .NULL );
114+ myArrayList .add (JSONObject .NULL );
115115 } else {
116116 x .back ();
117117 myArrayList .add (x .nextValue ());
@@ -155,7 +155,7 @@ public JSONArray(Collection collection) {
155155 if (collection != null ) {
156156 Iterator iter = collection .iterator ();
157157 while (iter .hasNext ()) {
158- myArrayList .add (JSON .wrap (iter .next ()));
158+ myArrayList .add (JSONObject .wrap (iter .next ()));
159159 }
160160 }
161161 }
@@ -170,7 +170,7 @@ public JSONArray(Object array) {
170170 if (array .getClass ().isArray ()) {
171171 int length = Array .getLength (array );
172172 for (int i = 0 ; i < length ; i += 1 ) {
173- this .append (JSON .wrap (Array .get (array , i )));
173+ this .append (JSONObject .wrap (Array .get (array , i )));
174174 }
175175 } else {
176176 throw new RuntimeException ("JSONArray initial value should be a string or collection or array." );
@@ -340,10 +340,10 @@ public JSONArray getArray(int index) {
340340 * @throws JSONException If there is no value for the index or if the
341341 * value is not a JSONObject
342342 */
343- public JSON getObject (int index ) {
343+ public JSONObject getObject (int index ) {
344344 Object object = this .get (index );
345- if (object instanceof JSON ) {
346- return (JSON )object ;
345+ if (object instanceof JSONObject ) {
346+ return (JSONObject )object ;
347347 }
348348 throw new RuntimeException ("JSONArray[" + index + "] is not a JSONObject." );
349349 }
@@ -559,7 +559,7 @@ public JSONArray append(Collection value) {
559559 */
560560 public JSONArray append (double value ) {
561561 Double d = new Double (value );
562- JSON .testValidity (d );
562+ JSONObject .testValidity (d );
563563 this .append (d );
564564 return this ;
565565 }
@@ -596,7 +596,7 @@ public JSONArray append(long value) {
596596 * @return this.
597597 */
598598 public JSONArray append (Map value ) {
599- this .append (new JSON (value ));
599+ this .append (new JSONObject (value ));
600600 return this ;
601601 }
602602
@@ -700,7 +700,7 @@ public JSONArray set(int index, long value) {
700700 * an invalid number.
701701 */
702702 public JSONArray set (int index , Map value ) {
703- this .set (index , new JSON (value ));
703+ this .set (index , new JSONObject (value ));
704704 return this ;
705705 }
706706
@@ -718,15 +718,15 @@ public JSONArray set(int index, Map value) {
718718 * an invalid number.
719719 */
720720 public JSONArray set (int index , Object value ) {
721- JSON .testValidity (value );
721+ JSONObject .testValidity (value );
722722 if (index < 0 ) {
723723 throw new RuntimeException ("JSONArray[" + index + "] not found." );
724724 }
725725 if (index < this .length ()) {
726726 this .myArrayList .set (index , value );
727727 } else {
728728 while (index != this .length ()) {
729- this .append (JSON .NULL );
729+ this .append (JSONObject .NULL );
730730 }
731731 this .append (value );
732732 }
@@ -750,7 +750,7 @@ public int length() {
750750 * @return true if the value at the index is null, or if there is no value.
751751 */
752752 public boolean isNull (int index ) {
753- return JSON .NULL .equals (this .opt (index ));
753+ return JSONObject .NULL .equals (this .opt (index ));
754754 }
755755
756756
@@ -860,7 +860,7 @@ Writer write(Writer writer, int indentFactor, int indent) {
860860 writer .write ('[' );
861861
862862 if (length == 1 ) {
863- JSON .writeValue (writer , this .myArrayList .get (0 ),
863+ JSONObject .writeValue (writer , this .myArrayList .get (0 ),
864864 indentFactor , indent );
865865 } else if (length != 0 ) {
866866 final int newindent = indent + indentFactor ;
@@ -872,15 +872,15 @@ Writer write(Writer writer, int indentFactor, int indent) {
872872 if (indentFactor > 0 ) {
873873 writer .write ('\n' );
874874 }
875- JSON .indent (writer , newindent );
876- JSON .writeValue (writer , this .myArrayList .get (i ),
875+ JSONObject .indent (writer , newindent );
876+ JSONObject .writeValue (writer , this .myArrayList .get (i ),
877877 indentFactor , newindent );
878878 commanate = true ;
879879 }
880880 if (indentFactor > 0 ) {
881881 writer .write ('\n' );
882882 }
883- JSON .indent (writer , indent );
883+ JSONObject .indent (writer , indent );
884884 }
885885 writer .write (']' );
886886 return writer ;
@@ -906,7 +906,7 @@ public String join(String separator) {
906906 if (i > 0 ) {
907907 sb .append (separator );
908908 }
909- sb .append (JSON .valueToString (this .myArrayList .get (i )));
909+ sb .append (JSONObject .valueToString (this .myArrayList .get (i )));
910910 }
911911 return sb .toString ();
912912 }
0 commit comments