You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] NullAssignment: False positive inside if statement for first assignment #1050
Description:
If there is a variable declaration without initializer, then the first assignment with null is considered already as a NullAssignment. This should be ignored, since it is the first assignment, which should be allowed by the rule.
changed the title [-] [java] NullAssignment false positive inside if statement[/-][+] [java] NullAssignment - false positive inside if statement[/+]on Dec 23, 2021
changed the title [-] [java] NullAssignment - false positive inside if statement[/-][+] [java] NullAssignment: False positive inside if statement for first assignment[/+]on Dec 19, 2025
changed the title [-] [java] NullAssignment: False positive inside if statement for first assignment[/-][+][java] NullAssignment: False positive inside if statement for first assignment[/+]on May 16, 2026
Activity
boris-petrov commentedon Aug 3, 2018
I think I've found another false-positive for this check (PMD version 6.6.0):
I think this also could be considered a bug in PMD, what do you think?
[-] [java] NullAssignment false positive inside if statement[/-][+] [java] NullAssignment - false positive inside if statement[/+][-] [java] NullAssignment - false positive inside if statement[/-][+] [java] NullAssignment: False positive inside if statement for first assignment[/+][-] [java] NullAssignment: False positive inside if statement for first assignment[/-][+][java] NullAssignment: False positive inside if statement for first assignment[/+][java] Fix pmd#1050: NullAssignment false positive inside if statemen…
[java] Fix pmd#1050: NullAssignment false positive inside if statemen…