<i18n dev> RFR: 8293008: Replace uses of StringBuffer with StringBuilder in MergeCollation

Jaikiran Pai jpai at openjdk.org
Tue Aug 30 09:02:00 UTC 2022


On Wed, 24 Aug 2022 19:31:23 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> Couple of package-private classes in `java.text` package still use `StringBuffer`: `MergeCollation` and `PatternEntry`.
> StringBuffer is a legacy synchronized class. StringBuilder is a direct replacement to StringBuffer which generally have better performance.

src/java.base/share/classes/java/text/PatternEntry.java line 55:

> 53:      * Gets the current extension, quoted
> 54:      */
> 55:     public void appendQuotedExtension(StringBuilder toAddTo) {

Hello Andrey, this and the other `public` method that's changed in this (package private) class don't seem to be used anywhere else other than this class itself. So maybe you could change them to `private` as part of this change?

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

PR: https://git.openjdk.org/jdk/pull/10007


More information about the i18n-dev mailing list