Skip to content

Commit bb55960

Browse files
author
Tim Watson
committed
merge bug24527 into default
2 parents 72b6e74 + 412dc81 commit bb55960

24 files changed

+1780
-457
lines changed

src/com/rabbitmq/tools/json/JSONReader.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,22 @@ private char next() {
5959
}
6060

6161
private void skipWhiteSpace() {
62-
while (Character.isWhitespace(c)) {
63-
next();
64-
}
62+
boolean cont;
63+
64+
do {
65+
cont = true;
66+
if (Character.isWhitespace(c)) {
67+
next();
68+
}
69+
else if (c == '/' && next() == '/') {
70+
while (c != '\n') {
71+
next();
72+
}
73+
}
74+
else {
75+
cont = false;
76+
}
77+
} while (cont);
6578
}
6679

6780
public Object read(String string) {
@@ -74,7 +87,7 @@ private Object read() {
7487
Object ret = null;
7588
skipWhiteSpace();
7689

77-
if (c == '"') {
90+
if (c == '"' || c == '\'') {
7891
next();
7992
ret = string();
8093
} else if (c == '[') {
@@ -168,7 +181,7 @@ private Object number() {
168181

169182
private Object string() {
170183
buf.setLength(0);
171-
while (c != '"') {
184+
while (c != '"' && c != '\'') {
172185
if (c == '\\') {
173186
next();
174187
if (c == 'u') {

0 commit comments

Comments
 (0)