[java] AvoidAccessibilityAlteration: Possible false positive in AvoidAccessibilityAlteration rule when using Lambda expression #4449
Labels
a:false-positive
PMD flags a piece of code that is not problematic
Milestone
Affects PMD Version: 7.0.0
Rule: AvoidAccessibilityAlteration
Description:
The AvoidAccessibilityAlteration rule might be reporting a false positive when using a Lambda expression instead of an anonymous class inside the
AccessController.doPrivileged
method. The violation is reported for thefield.setAccessible(true);
line within the Lambda expression.Code Sample demonstrating the issue:
Maybe a false positive:
Compliant code with anonymous class:
Expected outcome:
PMD should not report a violation at the line
field.setAccessible(true)
; within the Lambda expression since it's within theAccessController.doPrivileged
method. This appears to be a false positive.Running PMD through: [CLI]
The text was updated successfully, but these errors were encountered: