mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-05 12:25:36 -04:00
fixes object comparison
This commit is contained in:
parent
fb1db9341e
commit
e477d7002b
6
XML.java
6
XML.java
@ -186,7 +186,7 @@ public class XML {
|
|||||||
StringBuilder sb = new StringBuilder(string.length());
|
StringBuilder sb = new StringBuilder(string.length());
|
||||||
for (int i = 0, length = string.length(); i < length; i++) {
|
for (int i = 0, length = string.length(); i < length; i++) {
|
||||||
char c = string.charAt(i);
|
char c = string.charAt(i);
|
||||||
if (c == AMP) {
|
if (c == '&') {
|
||||||
final int semic = string.indexOf(';', i);
|
final int semic = string.indexOf(';', i);
|
||||||
if (semic > i) {
|
if (semic > i) {
|
||||||
final String entity = string.substring(i + 1, semic);
|
final String entity = string.substring(i + 1, semic);
|
||||||
@ -204,7 +204,7 @@ public class XML {
|
|||||||
if ("quot".equalsIgnoreCase(entity)) {
|
if ("quot".equalsIgnoreCase(entity)) {
|
||||||
sb.append('"');
|
sb.append('"');
|
||||||
} else if ("amp".equalsIgnoreCase(entity)) {
|
} else if ("amp".equalsIgnoreCase(entity)) {
|
||||||
sb.append(AMP);
|
sb.append('&');
|
||||||
} else if ("apos".equalsIgnoreCase(entity)) {
|
} else if ("apos".equalsIgnoreCase(entity)) {
|
||||||
sb.append('\'');
|
sb.append('\'');
|
||||||
} else if ("lt".equalsIgnoreCase(entity)) {
|
} else if ("lt".equalsIgnoreCase(entity)) {
|
||||||
@ -212,7 +212,7 @@ public class XML {
|
|||||||
} else if ("gt".equalsIgnoreCase(entity)) {
|
} else if ("gt".equalsIgnoreCase(entity)) {
|
||||||
sb.append('>');
|
sb.append('>');
|
||||||
} else {
|
} else {
|
||||||
sb.append(AMP).append(entity).append(';');
|
sb.append('&').append(entity).append(';');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// skip past the entity we just parsed.
|
// skip past the entity we just parsed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user