FindBugs Report=>Object.equals() 使用的问题

..........................................................................

原文提示应该是这样:It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)).
重写compareTo有一定的风险,因为你不知道JDK内部做对象对比时,到底使用了compareTo还是equals。例如:在JAVA5 里,PriorityQueue.remove中使用了compareTo,但JAVA6中,PriorityQueue.remove使用了equals方法。
所以if判断条件应该改成这样: (x.compareTo(y)==0) == (x.equals(y))

x和y换成真实值,return应该也需要这样(x.compareTo(y)==0) == (x.equals(y))