RFR: 8264484: Replace uses of StringBuffer with StringBuilder in jdk.hotspot.agent

Kevin Walls kevinw at openjdk.java.net
Wed Mar 31 15:45:09 UTC 2021


On Tue, 30 Mar 2021 18:58:24 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

> Found by IntelliJ IDEA inspection `Java | Java language level migration aids | Java 5 | 'StringBuffer' may be 'StringBuilder'`
> As suggested in https://github.com/openjdk/jdk/pull/1507#issuecomment-757369003 I've created separate PR for module `jdk.hotspot.agent`
> Similar cleanups in the past: https://bugs.openjdk.java.net/browse/JDK-8041679 https://bugs.openjdk.java.net/browse/JDK-8264029

Changes requested by kevinw (Committer).

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java line 887:

> 885:    protected String genMultPCHref(String pcs) {
> 886:       String buf = genBaseHref() + "pc_multiple=" + pcs;
> 887:       return buf;

This is like VMVersionMismatchException.java above, where as it is reduced to two lines, we may as well reduce it to one line with:
return genBaseHref() + ..etc... 

With these two minor changes, I think this looks good.

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

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



More information about the hotspot-gc-dev mailing list