thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer (Jira)" <j...@apache.org>
Subject [jira] [Resolved] (THRIFT-5016) Do Not Check 'other' For Null in Equals
Date Tue, 28 Jan 2020 21:55:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-5016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jens Geyer resolved THRIFT-5016.
--------------------------------
    Fix Version/s: 0.14.0
       Resolution: Fixed

> Do Not Check 'other' For Null in Equals
> ---------------------------------------
>
>                 Key: THRIFT-5016
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5016
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Compiler
>    Affects Versions: 0.13.0
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>             Fix For: 0.14.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code:java}
>   @Override
>   public boolean equals(java.lang.Object that) {
>     if (that == null)
>       return false;
>     if (that instanceof CrossPlatformResource)
>       return this.equals((CrossPlatformResource)that);
>     return false;
>   }
> {code}
> There is a null check before {{instanceof}}.  This check is superfluous:
> https://stackoverflow.com/questions/2950319/is-null-check-needed-before-calling-instanceof



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message