<AWT Dev> RFR: 8264428: Cleanup usages of StringBuffer in java.desktop [v2]

Alexander Zvegintsev azvegint at openjdk.java.net
Tue Apr 6 16:04:33 UTC 2021

On Tue, 30 Mar 2021 19:05:37 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.
> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision:
>   [PATCH] Replace uses of StringBuffer with StringBuilder in java.desktop

src/java.desktop/windows/classes/sun/java2d/d3d/D3DContext.java line 139:

> 137:         @Override
> 138:         public String toString() {
> 139:             StringBuilder buf = new StringBuilder(super.toString());

Looks like this is the only file where copyright year is not updated.


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

More information about the awt-dev mailing list