我已經等於此方法,但Findbugs報告錯誤,有什麼想法?奇怪的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)
檢查操作數是一個字符串
findbugs報告的錯誤是什麼? – 2010-12-23 05:56:40
它顯示什麼錯誤信息?它可能會顯示,如果你沒有重寫`hashCode()` – 2010-12-23 05:56:53