-
-
Notifications
You must be signed in to change notification settings - Fork 797
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit size of exception message (#744)
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/test/java/com/fasterxml/jackson/core/io/BigDecimalParserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.fasterxml.jackson.core.io; | ||
|
||
public class BigDecimalParserTest extends com.fasterxml.jackson.core.BaseTest { | ||
public void testLongStringParse() { | ||
final int len = 1500; | ||
final StringBuilder sb = new StringBuilder(len); | ||
for (int i = 0; i < len; i++) { | ||
sb.append("A"); | ||
} | ||
try { | ||
BigDecimalParser.parse(sb.toString()); | ||
fail("expected NumberFormatException"); | ||
} catch (NumberFormatException nfe) { | ||
assertTrue("exception message starts as expected?", nfe.getMessage().startsWith("Value \"AAAAA")); | ||
assertTrue("exception message value contains truncated", nfe.getMessage().contains("truncated")); | ||
} | ||
} | ||
} |