# Java StringBuilder suggestion in Java 11+ mostly obsolete

**URL:** <https://community.sonarsource.com/t/java-stringbuilder-suggestion-in-java-11-mostly-obsolete/143979>\
**Category:** SonarQube Cloud\
**Tags:** java\
**Created:** [July 7, 2025, 12:56pm UTC](https://community.sonarsource.com/t/java-stringbuilder-suggestion-in-java-11-mostly-obsolete/143979 "2025-07-07T12:56:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sten\_W](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Sten\_W](https://community.sonarsource.com/u/Sten_W)\
**Post date:** [July 7, 2025, 12:56pm UTC](https://community.sonarsource.com/t/java-stringbuilder-suggestion-in-java-11-mostly-obsolete/143979/1 "2025-07-07T12:56:46Z")

</div>

I wonder if you should revise/enhance the suggestion to use SpringBuilder instead of + in Java 11 and later code.  
[The StringBuilder advice is dead, or isn’t it? - Performance, Java, Testing, and Things](https://reneschwietzke.de/java/the-stringbuilder-advise-is-dead-or-isnt-it.html)  
It’s unnecessary in modern code with exception of loops.  
At least i think i saw complains about some few strings concatenation outside a loop, although i guess method might been called in a loop.

---

<div class="post-metadata">

**Author:** ![tomasz.tylenda](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tomasz.tylenda/32/77387_2.png) [@tomasz.tylenda](https://community.sonarsource.com/u/tomasz.tylenda)\
**Post date:** [July 30, 2025, 12:49pm UTC](https://community.sonarsource.com/t/java-stringbuilder-suggestion-in-java-11-mostly-obsolete/143979/5 "2025-07-30T12:49:38Z")

</div>

Hi Sten,

Your post was very timely, as we’ve recently been working on performance rules.

Modern JVMs can indeed change some of the classic advice. To make informed decisions, benchmarking is always essential, and performance tuning is only beneficial for code executed repeatedly.

To reflect this, we recently updated our performance rules with benchmarks. For example, [S1643](https://sonarsource.github.io/rspec/#/rspec/S1643/java) and [S3024](https://sonarsource.github.io/rspec/#/rspec/S3024/java) specifically address the usage of `StringBuilder`, but only for code called in loops.

Obviously, we may have missed some rules. If you identify any that appear obsolete, please let us know. We’ll create a ticket to address them in our next performance-related update.
