Skip to content

Commit 397a11a

Browse files
committed
Fix checkstyle
1 parent df185fe commit 397a11a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/main/java/com/grack/nanojson/JsonReader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public final class JsonReader implements Closeable {
3737
private int stateIndex = 0;
3838
private boolean inObject;
3939
private boolean first = true;
40+
// CHECKSTYLE_OFF: MagicNumber
4041
private CharBuffer key = CharBufferPool.get(1024);
42+
// CHECKSTYLE_ON: MagicNumber
4143

4244
/**
4345
* The type of value that the {@link JsonReader} is positioned over.

src/main/java/com/grack/nanojson/JsonTokener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ void consumeTokenString() throws JsonParserException {
401401
} else if (digit >= 'a' && digit <= 'f') {
402402
escaped |= (digit - 'a') + 10;
403403
} else {
404-
throw createParseException(null, "Expected unicode hex escape character: "
404+
throw createParseException(null,
405+
"Expected unicode hex escape character: "
405406
+ (char) digit + " (" + digit + ")", false);
406407
}
407408
}

src/main/java/com/grack/nanojson/JsonWriterBase.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ private void emitStringValue(String s) {
604604
}
605605
char lowSurrogate = s.charAt(i + 1);
606606
if (!Character.isLowSurrogate(lowSurrogate)) {
607-
throw new JsonWriterException(
608-
"Invalid surrogate pair: high surrogate not followed by low surrogate");
607+
throw new JsonWriterException("Invalid surrogate pair: "
608+
+ "high surrogate not followed by low surrogate");
609609
}
610610
// Need 4 bytes for any supplementary code point in UTF-8. Flush first if
611611
// insufficient space
@@ -626,7 +626,8 @@ private void emitStringValue(String s) {
626626
"Unable to encode character 0x" + Integer.toHexString(fc));
627627
}
628628
} else if (Character.isLowSurrogate(c)) {
629-
throw new JsonWriterException("Invalid low surrogate without preceding high surrogate");
629+
throw new JsonWriterException(
630+
"Invalid low surrogate without preceding high surrogate");
630631
} else {
631632
bb[bo++] = (byte) (0xe0 | c >> 12);
632633
bb[bo++] = (byte) (0x80 | (c >> 6) & 0x3f);

0 commit comments

Comments
 (0)