Affects PMD Version: 6.33.0
Rule: PrematureDeclaration
Description:
Don't report variables that are not used at all. Those should be left to UnusedLocalVariable.
Code Sample demonstrating the issue:
public String wrongEscapeSequences()
{
final String r1 = "\u0008"; // unused var - not a premature declaration
return "\u000csssdfsd";
}
(from https://github.com/checkstyle/checkstyle/blob/checkstyle-8.10/src/it/resources/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/InputIllegalTokenText.java#L17)
Expected outcome:
- Does PMD report a violation, where there shouldn't be one? -> false-positive
Affects PMD Version: 6.33.0
Rule: PrematureDeclaration
Description:
Don't report variables that are not used at all. Those should be left to UnusedLocalVariable.
Code Sample demonstrating the issue:
(from https://github.com/checkstyle/checkstyle/blob/checkstyle-8.10/src/it/resources/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/InputIllegalTokenText.java#L17)
Expected outcome: