On Wed, 20 Dec 2023 21:52:40 GMT, Roger Riggs <rri...@openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Clear sooner
>
> src/java.base/share/classes/java/lang/StringBuffer.java line 719:
> 
>> 717:     public synchronized StringBuffer repeat(int codePoint, int count) {
>> 718:         super.repeat(codePoint, count);
>> 719:         toStringCache = null;
> 
> The other cases in StringBuffer clear toStringCache *before* performing the 
> modification.
> For consistency, I'd suggest doing the same.

Changed

> src/java.base/share/classes/java/lang/StringBuffer.java line 731:
> 
>> 729:     public synchronized StringBuffer repeat(CharSequence cs, int count) 
>> {
>> 730:         super.repeat(cs, count);
>> 731:         toStringCache = null;
> 
> Ditto, clear toStringCache before the modification.

Changed

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17172#discussion_r1433234794
PR Review Comment: https://git.openjdk.org/jdk/pull/17172#discussion_r1433234928

Reply via email to