RFR: 8274879: Replace uses of StringBuffer with StringBuilder within java.base classes

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Thu Oct 7 07:35:21 UTC 2021

StringBuffer is a legacy synchronized class. There are more modern alternatives which perform better:
1. Plain String concatenation should be preferred
2. StringBuilder is a direct replacement to StringBuffer which generally have better performance

In [JDK-8264029](https://bugs.openjdk.java.net/browse/JDK-8264029)  I migrated only usages which were automatically detected by IDEA. It turns out there are more usages which can be migrated.


Commit messages:
 - [PATCH] Cleanup usages of StringBuffer in java.base module
 - [PATCH] Cleanup usages of StringBuffer in java.base module

Changes: https://git.openjdk.java.net/jdk/pull/5432/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5432&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8274879
  Stats: 32 lines in 12 files changed: 0 ins; 0 del; 32 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5432.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5432/head:pull/5432

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

More information about the security-dev mailing list