Skip to content

Commit d79aae8

Browse files
committed
Polish exception message
1 parent 10a67c6 commit d79aae8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3856,7 +3856,7 @@ private String _reportTruncatedUTF8InString(int strLenBytes, int truncatedCharOf
38563856
throws IOException
38573857
{
38583858
throw _constructError(String.format(
3859-
"Truncated UTF-8 character in Chunked Unicode String value (%d bytes): "
3859+
"Truncated UTF-8 character in Unicode String value (%d bytes): "
38603860
+"byte 0x%02X at offset #%d indicated %d more bytes needed",
38613861
strLenBytes, firstUTFByteValue, truncatedCharOffset, bytesExpected));
38623862
}

cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/fuzz/CBORFuzz_35979_StringValueTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void testInvalidTextValueWithBrokenUTF8() throws Exception
2727
p.getText();
2828
fail("Should not pass");
2929
} catch (StreamReadException e) {
30-
verifyException(e, "Truncated UTF-8 character in Chunked Unicode String value (256 bytes)");
30+
verifyException(e, "Truncated UTF-8 character in Unicode String value (256 bytes)");
3131
}
3232

3333
}

cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/parse/ParseInvalidUTF8String236Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void testShortString236EndsWithPartialUTF8AtEndOfStream() throws Exceptio
3737
String str = p.getText();
3838
fail("Should have failed, did not, String = '"+str+"'");
3939
} catch (StreamReadException e) {
40-
verifyException(e, "Truncated UTF-8 character in Chunked Unicode String value (3 bytes)");
40+
verifyException(e, "Truncated UTF-8 character in Unicode String value (3 bytes)");
4141
}
4242
}
4343
}
@@ -53,7 +53,7 @@ public void testShortString236EndsWithPartialUTF8() throws Exception
5353
String str = p.getText();
5454
fail("Should have failed, did not, String = '"+str+"'");
5555
} catch (StreamReadException e) {
56-
verifyException(e, "Truncated UTF-8 character in Chunked Unicode String value (2 bytes)");
56+
verifyException(e, "Truncated UTF-8 character in Unicode String value (2 bytes)");
5757
}
5858
}
5959
}

0 commit comments

Comments
 (0)