Skip to content

Commit a70de23

Browse files
committed
More error reporting refactoring
1 parent 10753a0 commit a70de23

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/deser/JacksonAvroParserImpl.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ private final void _finishLongText(int len) throws IOException
712712
break;
713713
default:
714714
// Is this good enough error message?
715-
_reportInvalidChar(c);
715+
_reportInvalidInitial(c);
716716
}
717717
// Need more room?
718718
if (outPtr >= outEnd) {
@@ -761,14 +761,6 @@ private final int _decodeUTF8_4(int c) throws IOException
761761
return ((c << 6) | (d & 0x3F)) - 0x10000;
762762
}
763763

764-
protected void _reportInvalidChar(int c) throws JsonParseException {
765-
// Either invalid WS or illegal UTF-8 start char
766-
if (c < ' ') {
767-
_throwInvalidSpace(c);
768-
}
769-
_reportInvalidInitial(c);
770-
}
771-
772764
private void _reportInvalidInitial(int mask) throws JsonParseException {
773765
_reportError("Invalid UTF-8 start byte 0x"+Integer.toHexString(mask));
774766
}

protobuf/src/main/java/com/fasterxml/jackson/dataformat/protobuf/ProtobufParser.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,7 @@ private final void _finishLongText(int len) throws IOException
20362036
break;
20372037
default:
20382038
// Is this good enough error message?
2039-
_reportInvalidChar(c);
2039+
_reportInvalidInitial(c);
20402040
}
20412041
// Need more room?
20422042
if (outPtr >= outEnd) {
@@ -2597,12 +2597,4 @@ private void _reportInvalidOther(int mask, int ptr) throws JsonParseException {
25972597
_inputPtr = ptr;
25982598
_reportInvalidOther(mask);
25992599
}
2600-
2601-
private void _reportInvalidChar(int c) throws JsonParseException {
2602-
// Either invalid WS or illegal UTF-8 start char
2603-
if (c < ' ') {
2604-
_throwInvalidSpace(c);
2605-
}
2606-
_reportInvalidInitial(c);
2607-
}
26082600
}

0 commit comments

Comments
 (0)