diff options
author | Roel Spilker <r.spilker@gmail.com> | 2014-01-19 21:49:35 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2014-01-19 21:49:35 +0100 |
commit | 14cc54527663018cdf7343eefffc8c37fbce93bb (patch) | |
tree | b8b45da7feb1217c31306f7024af37ea287d2b2e /test/transform/resource/after-ecj/EqualsAndHashCode.java | |
parent | 2ab6cc809d6aec8d253962547cab7e32598b84a7 (diff) | |
download | lombok-14cc54527663018cdf7343eefffc8c37fbce93bb.tar.gz lombok-14cc54527663018cdf7343eefffc8c37fbce93bb.tar.bz2 lombok-14cc54527663018cdf7343eefffc8c37fbce93bb.zip |
Issue 625: use (even) better primes for hashcodes
Diffstat (limited to 'test/transform/resource/after-ecj/EqualsAndHashCode.java')
-rw-r--r-- | test/transform/resource/after-ecj/EqualsAndHashCode.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/transform/resource/after-ecj/EqualsAndHashCode.java b/test/transform/resource/after-ecj/EqualsAndHashCode.java index 492f9344..625a0f87 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCode.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCode.java @@ -35,7 +35,7 @@ return (other instanceof EqualsAndHashCode); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 277; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); result = ((result * PRIME) + java.util.Arrays.hashCode(this.y)); @@ -52,6 +52,7 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { long y; float f; double d; + boolean b; EqualsAndHashCode2() { super(); } @@ -69,10 +70,12 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { return false; if ((java.lang.Double.compare(this.d, other.d) != 0)) return false; + if ((this.b != other.b)) + return false; return true; } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 277; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); final long $y = this.y; @@ -80,6 +83,7 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { result = ((result * PRIME) + java.lang.Float.floatToIntBits(this.f)); final long $d = java.lang.Double.doubleToLongBits(this.d); result = ((result * PRIME) + (int) ($d ^ ($d >>> 32))); + result = ((result * PRIME) + (this.b ? 79 : 97)); return result; } } @@ -125,7 +129,7 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte return (other instanceof EqualsAndHashCode4); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 277; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + super.hashCode()); return result; |