| 532 | } |
| 533 | |
| 534 | @Override |
| 535 | public synchronized int hashCode() { |
| 536 | int result = 0; |
| 537 | Iterator<Map.Entry<K, V>> it = entrySet().iterator(); |
| 538 | while (it.hasNext()) { |
| 539 | Map.Entry<K, V> entry = it.next(); |
| 540 | Object key = entry.getKey(); |
| 541 | if (key == this) { |
| 542 | continue; |
| 543 | } |
| 544 | Object value = entry.getValue(); |
| 545 | if (value == this) { |
| 546 | continue; |
| 547 | } |
| 548 | int hash = (key != null ? key.hashCode() : 0) |
| 549 | ^ (value != null ? value.hashCode() : 0); |
| 550 | result += hash; |
| 551 | } |
| 552 | return result; |
| 553 | } |
| 554 | |
| 555 | /** |
| 556 | * Returns true if this {@code Hashtable} has no key/value pairs. |