aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/EqualsAndHashCode.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-06-25 00:13:12 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-06-25 00:13:12 +0200
commit251fd03cd78ef6996d4252450bda596a5e8b11b9 (patch)
tree6cd9f4a8510ffabed01cd5eae60c0e1b6f2d2b35 /test/transform/resource/after-delombok/EqualsAndHashCode.java
parent23dcc9f5a5f3c24ccfb2f98ab556daed0dee3c89 (diff)
downloadlombok-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-delombok/EqualsAndHashCode.java')
-rw-r--r--test/transform/resource/after-delombok/EqualsAndHashCode.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/transform/resource/after-delombok/EqualsAndHashCode.java b/test/transform/resource/after-delombok/EqualsAndHashCode.java
index a15b71b0..d0ed4067 100644
--- a/test/transform/resource/after-delombok/EqualsAndHashCode.java
+++ b/test/transform/resource/after-delombok/EqualsAndHashCode.java
@@ -38,9 +38,9 @@ class EqualsAndHashCode {
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;
}
}