Skip to content

Commit 3935455

Browse files
committed
Merge remote branch 'douglascrockford/master'
Conflicts: JSONArray.java JSONML.java Test.java
2 parents 5f459eb + e13de0b commit 3935455

3 files changed

Lines changed: 315 additions & 308 deletions

File tree

JSONArray.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -108,29 +108,29 @@ public JSONArray(JSONTokener x) throws JSONException {
108108
throw x.syntaxError("A JSONArray text must start with '['");
109109
}
110110
if (x.nextClean() != ']') {
111-
x.back();
112-
for (;;) {
113-
if (x.nextClean() == ',') {
114-
x.back();
115-
this.myArrayList.add(JSONObject.NULL);
116-
} else {
117-
x.back();
118-
this.myArrayList.add(x.nextValue());
119-
}
120-
switch (x.nextClean()) {
121-
case ';':
122-
case ',':
123-
if (x.nextClean() == ']') {
124-
return;
125-
}
126-
x.back();
127-
break;
128-
case ']':
129-
return;
130-
default:
131-
throw x.syntaxError("Expected a ',' or ']'");
132-
}
133-
}
111+
x.back();
112+
for (;;) {
113+
if (x.nextClean() == ',') {
114+
x.back();
115+
this.myArrayList.add(JSONObject.NULL);
116+
} else {
117+
x.back();
118+
this.myArrayList.add(x.nextValue());
119+
}
120+
switch (x.nextClean()) {
121+
case ';':
122+
case ',':
123+
if (x.nextClean() == ']') {
124+
return;
125+
}
126+
x.back();
127+
break;
128+
case ']':
129+
return;
130+
default:
131+
throw x.syntaxError("Expected a ',' or ']'");
132+
}
133+
}
134134
}
135135
}
136136

@@ -152,12 +152,12 @@ public JSONArray(String source) throws JSONException {
152152
* @param collection A Collection.
153153
*/
154154
public JSONArray(Collection<?> collection) {
155-
this.myArrayList = new ArrayList<Object>();
156-
if (collection != null) {
157-
for( Object object : collection ) {
155+
this.myArrayList = new ArrayList<Object>();
156+
if (collection != null) {
157+
for( Object object : collection ) {
158158
this.myArrayList.add(JSONObject.wrap(object));
159-
}
160-
}
159+
}
160+
}
161161
}
162162

163163

@@ -774,7 +774,7 @@ public JSONArray put(int index, Object value) throws JSONException {
774774
* or null if there was no value.
775775
*/
776776
public Object remove(int index) {
777-
Object o = opt(index);
777+
Object o = opt(index);
778778
this.myArrayList.remove(index);
779779
return o;
780780
}

0 commit comments

Comments
 (0)