Skip to content

Commit 9660320

Browse files
author
Justin Lu
committed
8364781: Re-examine DigitList digits resizing during parsing
Reviewed-by: liach, naoto
1 parent 4680dc9 commit 9660320

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/java.base/share/classes/java/text/DigitList.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import java.math.BigInteger;
4343
import java.math.RoundingMode;
4444
import jdk.internal.math.FloatingDecimal;
45+
import jdk.internal.util.ArraysSupport;
4546

4647
/**
4748
* Digit List. Private to DecimalFormat.
@@ -153,7 +154,7 @@ public void clear () {
153154
*/
154155
public void append(char digit) {
155156
if (count == digits.length) {
156-
char[] data = new char[count + 100];
157+
char[] data = new char[ArraysSupport.newLength(count, 1, count)];
157158
System.arraycopy(digits, 0, data, 0, count);
158159
digits = data;
159160
}

0 commit comments

Comments
 (0)