Affects PMD Version:
6.49.0
Rule:
UnusedAssignment
https://pmd.sourceforge.io/pmd-6.49.0/pmd_rules_java_bestpractices.html#unusedassignment
Description:
Check the code sample
Code Sample demonstrating the issue:
Lock lock;
synchronized (locks) {
lock = locks.get(0);
}
try (lock) {
...
}
For some type Lock that is AutoCloseable.
Expected outcome:
PMD reports a violation at line lock = locks.get(0);, but that's wrong. That's a false positive.
Running PMD through: Gradle
Affects PMD Version:
6.49.0
Rule:
UnusedAssignment
https://pmd.sourceforge.io/pmd-6.49.0/pmd_rules_java_bestpractices.html#unusedassignment
Description:
Check the code sample
Code Sample demonstrating the issue:
For some type
Lockthat isAutoCloseable.Expected outcome:
PMD reports a violation at line
lock = locks.get(0);, but that's wrong. That's a false positive.Running PMD through: Gradle