A RetroSearch Logo

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

Search Query:

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

Wrong example in documentation · Issue #3374 · pmd/pmd · GitHub

Affects PMD Version:

Rule:UseStringBufferForStringAppends

Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_performance.html#usestringbufferforstringappends

Description:
Hi, I have encountered a false negative when PMD tried to detect UseStringBufferForStringAppends. Below is the test case for reproducing this false negative:

Code Sample demonstrating the issue:

public void testUseStringBufferForStringAppends() {
    String a;
    a = "foo";
    a += " bar"; // Should report a warning here
}

Expected outcome:Warning

PMD should report a violation at line 4, but doesn't. This is a false-negative.

Running PMD through: [Maven]


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