File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/main/java/com/fasterxml/jackson/core/base Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1554,16 +1554,20 @@ protected ContentReference _contentReferenceRedacted() {
1554
1554
return ContentReference .redacted ();
1555
1555
}
1556
1556
1557
- protected static int [] growArrayBy (int [] arr , int more ) throws StreamConstraintsException
1557
+ /* Helper method called by name-decoding methods that require storage
1558
+ * for "quads" (4-byte units encode as ints), when existing buffer
1559
+ * is full.
1560
+ */
1561
+ protected static int [] growArrayBy (int [] arr , int more ) throws IllegalArgumentException
1558
1562
{
1559
1563
if (arr == null ) {
1560
1564
return new int [more ];
1561
1565
}
1562
- final long len = arr .length + more ;
1563
- if (len > Integer . MAX_VALUE ) {
1564
- throw new StreamConstraintsException ("Unable to grow array to longer to Integer.MAX_VALUE" );
1566
+ final int len = arr .length + more ;
1567
+ if (len < 0 ) {
1568
+ throw new IllegalArgumentException ("Unable to grow array to longer to ` Integer.MAX_VALUE` " );
1565
1569
}
1566
- return Arrays .copyOf (arr , ( int ) len );
1570
+ return Arrays .copyOf (arr , len );
1567
1571
}
1568
1572
1569
1573
/*
You can’t perform that action at this time.
0 commit comments