File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
src/main/java/com/grack/nanojson Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments