Skip to content

Commit dd7056c

Browse files
authored
Merge pull request stleary#495 from harkue/master
fix typo
2 parents 4b49bc9 + e62d763 commit dd7056c

4 files changed

Lines changed: 29 additions & 30 deletions

File tree

JSONArray.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ public Writer write(Writer writer) throws JSONException {
14091409
public Writer write(Writer writer, int indentFactor, int indent)
14101410
throws JSONException {
14111411
try {
1412-
boolean commanate = false;
1412+
boolean needsComma = false;
14131413
int length = this.length();
14141414
writer.write('[');
14151415

@@ -1421,23 +1421,23 @@ public Writer write(Writer writer, int indentFactor, int indent)
14211421
throw new JSONException("Unable to write JSONArray value at index: 0", e);
14221422
}
14231423
} else if (length != 0) {
1424-
final int newindent = indent + indentFactor;
1424+
final int newIndent = indent + indentFactor;
14251425

14261426
for (int i = 0; i < length; i += 1) {
1427-
if (commanate) {
1427+
if (needsComma) {
14281428
writer.write(',');
14291429
}
14301430
if (indentFactor > 0) {
14311431
writer.write('\n');
14321432
}
1433-
JSONObject.indent(writer, newindent);
1433+
JSONObject.indent(writer, newIndent);
14341434
try {
14351435
JSONObject.writeValue(writer, this.myArrayList.get(i),
1436-
indentFactor, newindent);
1436+
indentFactor, newIndent);
14371437
} catch (Exception e) {
14381438
throw new JSONException("Unable to write JSONArray value at index: " + i, e);
14391439
}
1440-
commanate = true;
1440+
needsComma = true;
14411441
}
14421442
if (indentFactor > 0) {
14431443
writer.write('\n');

JSONObject.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ protected static Number stringToNumber(final String val) throws NumberFormatExce
21412141
//}
21422142
//return new BigInteger(val);
21432143

2144-
// BigInteger version: We use a similar bitLenth compare as
2144+
// BigInteger version: We use a similar bitLength compare as
21452145
// BigInteger#intValueExact uses. Increases GC, but objects hold
21462146
// only what they need. i.e. Less runtime overhead if the value is
21472147
// long lived. Which is the better tradeoff? This is closer to what's
@@ -2496,7 +2496,7 @@ static final void indent(Writer writer, int indent) throws IOException {
24962496
public Writer write(Writer writer, int indentFactor, int indent)
24972497
throws JSONException {
24982498
try {
2499-
boolean commanate = false;
2499+
boolean needsComma = false;
25002500
final int length = this.length();
25012501
writer.write('{');
25022502

@@ -2514,27 +2514,27 @@ public Writer write(Writer writer, int indentFactor, int indent)
25142514
throw new JSONException("Unable to write JSONObject value for key: " + key, e);
25152515
}
25162516
} else if (length != 0) {
2517-
final int newindent = indent + indentFactor;
2517+
final int newIndent = indent + indentFactor;
25182518
for (final Entry<String,?> entry : this.entrySet()) {
2519-
if (commanate) {
2519+
if (needsComma) {
25202520
writer.write(',');
25212521
}
25222522
if (indentFactor > 0) {
25232523
writer.write('\n');
25242524
}
2525-
indent(writer, newindent);
2525+
indent(writer, newIndent);
25262526
final String key = entry.getKey();
25272527
writer.write(quote(key));
25282528
writer.write(':');
25292529
if (indentFactor > 0) {
25302530
writer.write(' ');
25312531
}
25322532
try {
2533-
writeValue(writer, entry.getValue(), indentFactor, newindent);
2533+
writeValue(writer, entry.getValue(), indentFactor, newIndent);
25342534
} catch (Exception e) {
25352535
throw new JSONException("Unable to write JSONObject value for key: " + key, e);
25362536
}
2537-
commanate = true;
2537+
needsComma = true;
25382538
}
25392539
if (indentFactor > 0) {
25402540
writer.write('\n');

XML.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class XML {
6666
public static final Character SLASH = '/';
6767

6868
/**
69-
* Null attrubute name
69+
* Null attribute name
7070
*/
7171
public static final String NULL_ATTR = "xsi:nil";
7272

@@ -251,7 +251,7 @@ private static boolean parse(XMLTokener x, JSONObject context, String name, XMLP
251251
throws JSONException {
252252
char c;
253253
int i;
254-
JSONObject jsonobject = null;
254+
JSONObject jsonObject = null;
255255
String string;
256256
String tagName;
257257
Object token;
@@ -332,7 +332,7 @@ private static boolean parse(XMLTokener x, JSONObject context, String name, XMLP
332332
} else {
333333
tagName = (String) token;
334334
token = null;
335-
jsonobject = new JSONObject();
335+
jsonObject = new JSONObject();
336336
boolean nilAttributeFound = false;
337337
for (;;) {
338338
if (token == null) {
@@ -353,14 +353,14 @@ private static boolean parse(XMLTokener x, JSONObject context, String name, XMLP
353353
&& Boolean.parseBoolean((String) token)) {
354354
nilAttributeFound = true;
355355
} else if (!nilAttributeFound) {
356-
jsonobject.accumulate(string,
356+
jsonObject.accumulate(string,
357357
config.keepStrings
358358
? ((String) token)
359359
: stringToValue((String) token));
360360
}
361361
token = null;
362362
} else {
363-
jsonobject.accumulate(string, "");
363+
jsonObject.accumulate(string, "");
364364
}
365365

366366

@@ -371,8 +371,8 @@ private static boolean parse(XMLTokener x, JSONObject context, String name, XMLP
371371
}
372372
if (nilAttributeFound) {
373373
context.accumulate(tagName, JSONObject.NULL);
374-
} else if (jsonobject.length() > 0) {
375-
context.accumulate(tagName, jsonobject);
374+
} else if (jsonObject.length() > 0) {
375+
context.accumulate(tagName, jsonObject);
376376
} else {
377377
context.accumulate(tagName, "");
378378
}
@@ -390,21 +390,20 @@ private static boolean parse(XMLTokener x, JSONObject context, String name, XMLP
390390
} else if (token instanceof String) {
391391
string = (String) token;
392392
if (string.length() > 0) {
393-
jsonobject.accumulate(config.cDataTagName,
393+
jsonObject.accumulate(config.cDataTagName,
394394
config.keepStrings ? string : stringToValue(string));
395395
}
396396

397397
} else if (token == LT) {
398398
// Nested element
399-
if (parse(x, jsonobject, tagName, config)) {
400-
if (jsonobject.length() == 0) {
399+
if (parse(x, jsonObject, tagName, config)) {
400+
if (jsonObject.length() == 0) {
401401
context.accumulate(tagName, "");
402-
} else if (jsonobject.length() == 1
403-
&& jsonobject.opt(config.cDataTagName) != null) {
404-
context.accumulate(tagName,
405-
jsonobject.opt(config.cDataTagName));
402+
} else if (jsonObject.length() == 1
403+
&& jsonObject.opt(config.cDataTagName) != null) {
404+
context.accumulate(tagName, jsonObject.opt(config.cDataTagName));
406405
} else {
407-
context.accumulate(tagName, jsonobject);
406+
context.accumulate(tagName, jsonObject);
408407
}
409408
return false;
410409
}
@@ -731,7 +730,7 @@ public static String toString(final Object object, final String tagName, final X
731730
}
732731
if (tagName != null) {
733732

734-
// Emit the </tagname> close tag
733+
// Emit the </tagName> close tag
735734
sb.append("</");
736735
sb.append(tagName);
737736
sb.append('>');

XMLTokener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public Object nextEntity(@SuppressWarnings("unused") char ampersand) throws JSON
152152
}
153153

154154
/**
155-
* Unescapes an XML entity encoding;
155+
* Unescape an XML entity encoding;
156156
* @param e entity (only the actual entity value, not the preceding & or ending ;
157157
* @return
158158
*/

0 commit comments

Comments
 (0)