David Mollitor created THRIFT-5016:
--------------------------------------
Summary: 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
{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)