Affects PMD Version:6.42.0
Rule:SimplifyBooleanReturns
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_design.html#simplifybooleanreturns
Description:
Hi, I found a false negative about the rule SimplifyBooleanReturns. Please read the following code example. PMD should have reported a warning at line 3, but it doesn't. However, I think this if-else statement can be simplified. Hence, I think this is a false negative.
Code Sample demonstrating the issue:
public boolean foo() {
if (true) { // should report a warning in this if-else statement
return (true || false);
} else {
return false;
}
}
Expected outcome:A warning
PMD should report a violation at line 2, but doesn't. This is a false-negative.
Running PMD through: [Maven]
Affects PMD Version:6.42.0
Rule:SimplifyBooleanReturns
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_design.html#simplifybooleanreturns
Description:
Hi, I found a false negative about the rule SimplifyBooleanReturns. Please read the following code example. PMD should have reported a warning at line 3, but it doesn't. However, I think this if-else statement can be simplified. Hence, I think this is a false negative.
Code Sample demonstrating the issue:
Expected outcome:A warning
PMD should report a violation at line 2, but doesn't. This is a false-negative.
Running PMD through: [Maven]