Похожие чаты

Which objects are in that HashSet? It may be possible

because of poorly defined equals() and / or hashCode() methods

1 ответов

13 просмотров

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!

Похожие вопросы

Обсуждают сегодня

Карта сайта