diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-06-25 00:13:12 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-06-25 00:13:12 +0200 |
commit | 251fd03cd78ef6996d4252450bda596a5e8b11b9 (patch) | |
tree | 6cd9f4a8510ffabed01cd5eae60c0e1b6f2d2b35 /test/transform/resource/after-ecj/EqualsAndHashCode.java | |
parent | 23dcc9f5a5f3c24ccfb2f98ab556daed0dee3c89 (diff) | |
download | lombok-251fd03cd78ef6996d4252450bda596a5e8b11b9.tar.gz lombok-251fd03cd78ef6996d4252450bda596a5e8b11b9.tar.bz2 lombok-251fd03cd78ef6996d4252450bda596a5e8b11b9.zip |
The hashCode() method now generates a magic prime instead of 0 for the hash of null values; this reduces collisions.
Diffstat (limited to 'test/transform/resource/after-ecj/EqualsAndHashCode.java')
-rw-r--r-- | test/transform/resource/after-ecj/EqualsAndHashCode.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/transform/resource/after-ecj/EqualsAndHashCode.java b/test/transform/resource/after-ecj/EqualsAndHashCode.java index 7db65c82..c0bb5bbb 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCode.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCode.java @@ -41,9 +41,9 @@ result = ((result * PRIME) + java.util.Arrays.hashCode(this.y)); result = ((result * PRIME) + java.util.Arrays.deepHashCode(this.z)); final java.lang.Object $a = this.a; - result = ((result * PRIME) + (($a == null) ? 0 : $a.hashCode())); + result = ((result * PRIME) + (($a == null) ? 43 : $a.hashCode())); final java.lang.Object $b = this.b; - result = ((result * PRIME) + (($b == null) ? 0 : $b.hashCode())); + result = ((result * PRIME) + (($b == null) ? 43 : $b.hashCode())); return result; } } |