RFR: 8316150: Refactor get chars and string size [v7]
Chen Liang
liach at openjdk.org
Fri Sep 22 11:40:19 UTC 2023
On Fri, 22 Sep 2023 09:22:04 GMT, 温绍锦 <duke at openjdk.org> wrote:
>> 1. Reduce duplicate stringSize code
>> 2. Move java.lang.StringLatin1.getChars to jdk.internal.util.DecimalDigits::getCharLatin1,not only java.lang, other packages also need to use this method
>
> 温绍锦 has updated the pull request incrementally with one additional commit since the last revision:
>
> restore HexDigits & OctalDigits
src/java.base/share/classes/java/util/FormatItem.java line 148:
> 146: int length = DecimalDigits.stringSize(value);
> 147: this.digits = new byte[length];
> 148: DecimalDigits.getCharsLatin1(value, length, this.digits);
Sorry missed this one in last round of review. This is wrong if you mix number fornat items and chinese segments in a String Template.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15699#discussion_r1334265520
More information about the core-libs-dev
mailing list