Affects PMD Version: 6.3.0+, 7.0.0
Rule: NullAssignment
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.
Code Sample demonstrating the issue:
String key;
if (a) {
key = "a";
} else if (b) {
key = "b";
} else {
key = null;
}
See #629 for the original issue.
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Affects PMD Version: 6.3.0+, 7.0.0
Rule: NullAssignment
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.
Code Sample demonstrating the issue:
See #629 for the original issue.
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]