Skip to content

Commit 1c1914c

Browse files
committed
Change test to try to reproduce #493, did not happen.
1 parent 8a63762 commit 1c1914c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/test/java/com/fasterxml/jackson/core/read/NumberOverflowTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ class NumberOverflowTest
1414
extends JUnit5TestBase
1515
{
1616
private final JsonFactory FACTORY = JsonFactory.builder()
17-
.streamReadConstraints(StreamReadConstraints.builder().maxNumberLength(1000000).build())
17+
.streamReadConstraints(StreamReadConstraints.builder().maxNumberLength(1_000_000).build())
1818
.build();
1919

2020
// NOTE: this should be long enough to trigger perf problems
21-
// 19-
22-
private final static int BIG_NUM_LEN = 199999;
21+
private final static int BIG_NUM_LEN = 199_999;
2322
private final static String BIG_POS_INTEGER;
2423
static {
2524
StringBuilder sb = new StringBuilder(BIG_NUM_LEN);
@@ -67,13 +66,12 @@ void simpleLongOverflow() throws Exception
6766
}
6867

6968
// Note: only 4 cardinal types; `short`, `byte` and `char` use same code paths
70-
// Note: due to [jackson-core#493], we'll skip DataInput-backed parser
7169

7270
// [jackson-core#488]
7371
@Test
7472
void maliciousLongOverflow() throws Exception
7573
{
76-
for (int mode : ALL_STREAMING_MODES) {
74+
for (int mode : ALL_MODES) {
7775
for (String doc : new String[] { BIG_POS_DOC, BIG_NEG_DOC }) {
7876
JsonParser p = createParser(FACTORY, mode, doc);
7977
assertToken(JsonToken.START_ARRAY, p.nextToken());
@@ -94,7 +92,7 @@ void maliciousLongOverflow() throws Exception
9492
@Test
9593
void maliciousIntOverflow() throws Exception
9694
{
97-
for (int mode : ALL_STREAMING_MODES) {
95+
for (int mode : ALL_MODES) {
9896
for (String doc : new String[] { BIG_POS_DOC, BIG_NEG_DOC }) {
9997
JsonParser p = createParser(FACTORY, mode, doc);
10098
assertToken(JsonToken.START_ARRAY, p.nextToken());
@@ -115,7 +113,7 @@ void maliciousIntOverflow() throws Exception
115113
@Test
116114
void maliciousBigIntToDouble() throws Exception
117115
{
118-
for (int mode : ALL_STREAMING_MODES) {
116+
for (int mode : ALL_MODES) {
119117
final String doc = BIG_POS_DOC;
120118
JsonParser p = createParser(FACTORY, mode, doc);
121119
assertToken(JsonToken.START_ARRAY, p.nextToken());
@@ -131,7 +129,7 @@ void maliciousBigIntToDouble() throws Exception
131129
@Test
132130
void maliciousBigIntToFloat() throws Exception
133131
{
134-
for (int mode : ALL_STREAMING_MODES) {
132+
for (int mode : ALL_MODES) {
135133
final String doc = BIG_POS_DOC;
136134
JsonParser p = createParser(FACTORY, mode, doc);
137135
assertToken(JsonToken.START_ARRAY, p.nextToken());

0 commit comments

Comments
 (0)