because of poorly defined equals() and / or hashCode() methods
When I call remove(item) on the Set, the equals() never gets called. The hashCode() gets called once. In HashMap.java: if ((tab = table) != null && (n = tab.length) > 0 && (p = tab[index = (n - 1) & hash]) != null) The last condition becomes false so it detects the element doesn't exists. May be poor hashCode. I am finding the reason!
Обсуждают сегодня