#1197 Add a rule that checks types of arguments passed to Objects.equals(Object, Object) method

2.0.3
closed-fixed
None
5
2013-09-11
2013-07-25
John Kozlov
No
Integer x = 5;
String y = "5";
System.out.println(java.util.Objects.equals(x, y));

FindBugs should detect that Objects.equals compares references of unrelated types here.

It would be also great if it worked for com.google.common.base.Objects.equal(Object, Object) from Google Guava library (which is very popular) as well.

Discussion

  • William Pugh

    William Pugh - 2013-09-11
    • status: open --> open-accepted
    • assigned_to: William Pugh
     
  • William Pugh

    William Pugh - 2013-09-11
    • status: open-accepted --> closed-fixed
     
  • William Pugh

    William Pugh - 2013-09-11

    fixed. Thanks.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks