A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1736 below:

False positive if only one concatenation · Issue #1736 · pmd/pmd · GitHub

Affects PMD Version: 6.12

Rule: UseStringBufferForStringAppends

Description:
In the code sample provided below PMD wants me to use a StringBuilder to do the concatenation.
That would be the better solution if there were more than one concatenation, especially inside a loop.
But in this case replacing the only concatenation with a StringBuilder would be the same the compiler does anyway.

Code Sample demonstrating the issue:

public void doSomething(String s1) {
	String s2 = "a";
	s2 += s1;
}

Running PMD through: Eclipse


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4