An implementation for Set#hashCode().
(Set<?> s)
| 1440 | |
| 1441 | |
| 1442 | static int hashCodeImpl(Set<?> s) { |
| 1443 | int hashCode = 0; |
| 1444 | for (Object o : s) { |
| 1445 | hashCode += o != null ? o.hashCode() : 0; |
| 1446 | hashCode = ~~hashCode; |
| 1447 | // Needed to deal with unusual integer overflow in GWT. |
| 1448 | } |
| 1449 | return hashCode; |
| 1450 | } |
| 1451 | |
| 1452 | /** |
| 1453 | * An implementation for {@link Set#equals(Object)}. |
no test coverage detected