diff --git a/avro/src/main/java/tools/jackson/dataformat/avro/deser/JacksonAvroParserImpl.java b/avro/src/main/java/tools/jackson/dataformat/avro/deser/JacksonAvroParserImpl.java index 2cdaacdb2..a629d8dbe 100644 --- a/avro/src/main/java/tools/jackson/dataformat/avro/deser/JacksonAvroParserImpl.java +++ b/avro/src/main/java/tools/jackson/dataformat/avro/deser/JacksonAvroParserImpl.java @@ -721,7 +721,7 @@ private final void _finishLongText(int len) throws IOException break; default: // Is this good enough error message? - _reportInvalidChar(c); + _reportInvalidInitial(c); } // Need more room? if (outPtr >= outEnd) { @@ -770,14 +770,6 @@ private final int _decodeUTF8_4(int c) throws IOException return ((c << 6) | (d & 0x3F)) - 0x10000; } - protected void _reportInvalidChar(int c) throws JacksonException { - // Either invalid WS or illegal UTF-8 start char - if (c < ' ') { - _throwInvalidSpace(c); - } - _reportInvalidInitial(c); - } - private void _reportInvalidInitial(int mask) throws JacksonException { _reportError("Invalid UTF-8 start byte 0x"+Integer.toHexString(mask)); } diff --git a/protobuf/src/main/java/tools/jackson/dataformat/protobuf/ProtobufParser.java b/protobuf/src/main/java/tools/jackson/dataformat/protobuf/ProtobufParser.java index 07c7086ff..97083b4c7 100644 --- a/protobuf/src/main/java/tools/jackson/dataformat/protobuf/ProtobufParser.java +++ b/protobuf/src/main/java/tools/jackson/dataformat/protobuf/ProtobufParser.java @@ -2102,7 +2102,7 @@ private final void _finishLongText(int len) throws JacksonException break; default: // Is this good enough error message? - _reportInvalidChar(c); + _reportInvalidInitial(c); } // Need more room? if (outPtr >= outEnd) { @@ -2665,12 +2665,4 @@ private void _reportInvalidOther(int mask, int ptr) throws StreamReadException { _inputPtr = ptr; _reportInvalidOther(mask); } - - private void _reportInvalidChar(int c) throws StreamReadException { - // Either invalid WS or illegal UTF-8 start char - if (c < ' ') { - _throwInvalidSpace(c); - } - _reportInvalidInitial(c); - } }