We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Affects PMD Version: 7.0.0-rc4
Rule: SimplifyBooleanReturns
Description:
I think, the suggested solution would result in wrong code.
Code Sample demonstrating the issue:
if (a == null) { return false; } return "FOO".equals(a.toString());
The suggestion is:
This if statement can be replaced by `return !{condition} || {elseBranch};`.
I think, this is wrong, it should be
This if statement can be replaced by `return !{condition} && {elseBranch};`.
The text was updated successfully, but these errors were encountered:
With PMD 7.3.0, this is still wrong.
Code:
if (StringUtils.isAnyBlank(stringA, stringB)) { return false; } return Objects.equals(stringA, stringB);
PMD Error:
SimplifyBooleanReturns: This if statement can be replaced by `return !{condition} || {elseBranch};`
But as OP said, it should be && instead of ||.
&&
||
Sorry, something went wrong.
bd280ba
[doc] Update release notes (#4763, #5373)
ea32fbb
[java] Fix #4763 - wrong message for SimplifyBooleanReturns (#5373)
df2d20e
Merge pull request #5373 from oowekyala:issue4763-simplifyBooleanReturns-message
Successfully merging a pull request may close this issue.
Affects PMD Version: 7.0.0-rc4
Rule: SimplifyBooleanReturns
Description:
I think, the suggested solution would result in wrong code.
Code Sample demonstrating the issue:
The suggestion is:
I think, this is wrong, it should be
The text was updated successfully, but these errors were encountered: