mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-15 13:49:42 +02:00
8364781: Re-examine DigitList digits resizing during parsing
Reviewed-by: liach, naoto
This commit is contained in:
parent
4680dc9831
commit
9660320041
1 changed files with 2 additions and 1 deletions
|
@ -42,6 +42,7 @@ import java.math.BigDecimal;
|
|||
import java.math.BigInteger;
|
||||
import java.math.RoundingMode;
|
||||
import jdk.internal.math.FloatingDecimal;
|
||||
import jdk.internal.util.ArraysSupport;
|
||||
|
||||
/**
|
||||
* Digit List. Private to DecimalFormat.
|
||||
|
@ -153,7 +154,7 @@ final class DigitList implements Cloneable {
|
|||
*/
|
||||
public void append(char digit) {
|
||||
if (count == digits.length) {
|
||||
char[] data = new char[count + 100];
|
||||
char[] data = new char[ArraysSupport.newLength(count, 1, count)];
|
||||
System.arraycopy(digits, 0, data, 0, count);
|
||||
digits = data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue