Menu

#1366 UselessParentheses false positive on multiple equality operators

PMD-5.3.3
closed
PMD
4-Minor
Bug
5.3.2
Unnecessary / UselessParentheses
2015-06-01
2015-06-01
Thrawn
No

PMD rejects a line of code that checks two values to see whether they are either both null, or both non-null, complaining that the parentheses are useless:

return (a == null) == (b == null);

However, I can't see a way to re-write this correctly and concisely without the parentheses.

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-06-01
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.3
     

Log in to post a comment.