| 522 | } |
| 523 | |
| 524 | @Override |
| 525 | public synchronized int hashCode() { |
| 526 | int result = 0; |
| 527 | Iterator<Map.Entry<K, V>> it = entrySet().iterator(); |
| 528 | while (it.hasNext()) { |
| 529 | Map.Entry<K, V> entry = it.next(); |
| 530 | Object key = entry.getKey(); |
| 531 | if (key == this) { |
| 532 | continue; |
| 533 | } |
| 534 | Object value = entry.getValue(); |
| 535 | if (value == this) { |
| 536 | continue; |
| 537 | } |
| 538 | int hash = (key != null ? key.hashCode() : 0) |
| 539 | ^ (value != null ? value.hashCode() : 0); |
| 540 | result += hash; |
| 541 | } |
| 542 | return result; |
| 543 | } |
| 544 | |
| 545 | /// Returns true if this `Hashtable` has no key/value pairs. |
| 546 | /// |