|
6 | 6 | *******************************************************************************/ |
7 | 7 | package org.danilopianini.util; |
8 | 8 |
|
9 | | -import static java.lang.Math.ceil; |
10 | | -import static java.lang.Math.floor; |
11 | | -import static java.lang.Math.max; |
12 | | -import static java.lang.Math.min; |
13 | | -import static java.lang.Math.nextDown; |
14 | | -import static java.lang.Math.nextUp; |
| 9 | +import com.google.common.base.Optional; |
| 10 | +import com.google.common.hash.Hashing; |
15 | 11 |
|
| 12 | +import javax.annotation.Nonnull; |
16 | 13 | import java.io.Serializable; |
17 | 14 | import java.util.ArrayList; |
18 | 15 | import java.util.Collections; |
|
22 | 19 | import java.util.List; |
23 | 20 | import java.util.Objects; |
24 | 21 |
|
25 | | -import javax.annotation.Nonnull; |
26 | | -import com.google.common.base.Optional; |
27 | | -import com.google.common.hash.Hasher; |
28 | | -import com.google.common.hash.Hashing; |
| 22 | +import static java.lang.Math.ceil; |
| 23 | +import static java.lang.Math.floor; |
| 24 | +import static java.lang.Math.max; |
| 25 | +import static java.lang.Math.min; |
| 26 | +import static java.lang.Math.nextDown; |
| 27 | +import static java.lang.Math.nextUp; |
29 | 28 |
|
30 | 29 | /** |
31 | 30 | * |
@@ -539,12 +538,14 @@ public boolean equals(final Object obj) { |
539 | 538 | } |
540 | 539 |
|
541 | 540 | @Override |
| 541 | + @SuppressWarnings("UnstableApiUsage") |
542 | 542 | public int hashCode() { |
543 | | - final Hasher hasher = Hashing.murmur3_32().newHasher(); |
544 | | - hasher.putDouble(x); |
545 | | - hasher.putDouble(y); |
546 | | - hasher.putInt(element.hashCode()); |
547 | | - return hasher.hash().asInt(); |
| 543 | + return Hashing.murmur3_32_fixed().newHasher() |
| 544 | + .putDouble(x) |
| 545 | + .putDouble(y) |
| 546 | + .putInt(element.hashCode()) |
| 547 | + .hash() |
| 548 | + .asInt(); |
548 | 549 | } |
549 | 550 |
|
550 | 551 | public boolean isIn(final double sx, final double sy, final double fx, final double fy) { |
|
0 commit comments