Affects PMD Version:
6.19.0
Rule:
UnusedLocalVariable
Description:
An unused array object is not flagged as unused but flagged as DU-anomaly by rule DataflowAnomalyAnalysis. Both should happen. Comment in code states that this is a TODO.
https://github.com/pmd/pmd/blob/master/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/bestpractices/UnusedLocalVariableRule.java
Code Sample demonstrating the issue:
package pmdtests; import java.lang.reflect.Constructor; public final class Construct { private Construct() { throw new IllegalStateException("Private constructor."); } public static void main(String... args) { // get all visible constructors Constructor<?>[] constructors = String.class.getConstructors(); } }
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
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