<AWT Dev> Integrated: 8264428: Cleanup usages of StringBuffer in java.desktop

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Thu Apr 8 21:27:14 UTC 2021


On Mon, 29 Mar 2021 20:50:14 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

> There are few possible cleanups in java.desktop related to legacy StringBuffer usages:
> 1. In few places StringBuffer can be replaced with plain String concatenation.
> 2. StringBuffer can be replaced with StringBuilder. StringBuilder has better performance as it is not thread-safe.
> 3. There are few places where result of string concatenation is passed to StringBuffer.append method. Using separate `.append` calls is more clear.
> 4. In few places primitives are unnecessary converted to String before `.append` call. They can be replaced with specialized methods (like `.append(int)` calls.

This pull request has now been integrated.

Changeset: 8a235807
Author:    Andrey Turbanov <turbanoff at gmail.com>
Committer: Alexander Zvegintsev <azvegint at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/8a235807
Stats:     48 lines in 11 files changed: 3 ins; 8 del; 37 mod

8264428: Cleanup usages of StringBuffer in java.desktop

Reviewed-by: azvegint, aivanov

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

PR: https://git.openjdk.java.net/jdk/pull/3251


More information about the awt-dev mailing list