Menu

#214 Good practice for the use of equals()

closed-rejected
5
2017-10-22
2010-07-08
Anonymous
No

In the statement A.equals(B), if B is a constant/Java enum, it is recommended to use B.equals(A). This help to avoid NPE at runtime which Findbugs can't detect.

Discussion

  • Keith Lea

    Keith Lea - 2010-07-19
    • assigned_to: nobody --> wpugh
    • status: open --> open-accepted
     
  • Keith Lea

    Keith Lea - 2010-07-19

    Bill - see RFE3026970

     
  • Andrey Loskutov

    Andrey Loskutov - 2017-10-22
    • Labels: new bug pattern --> new bug pattern, report on spotbugs
    • Status: open-accepted --> closed-rejected
     

Log in to post a comment.