我有 equals 这种方法,但是 Findbugs 报告错误,知道吗?
@Override
public boolean equals(final Object obj) {
return obj instanceof String && this.value != null
&& this.value.equals(obj); // this.value is a String
}
错误是:
Myclass.equals(Object)
检查操作数是否为字符串