diff options
author | Roel Spilker <r.spilker@gmail.com> | 2017-11-06 23:45:52 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2017-11-06 23:46:09 +0100 |
commit | 045638ec1f79f68747f135061d2e026faa719642 (patch) | |
tree | debabf20d4cb9af4c8c6ed20d6044744c537705f /test/transform/resource/after-delombok | |
parent | 7fad34b0a6fbda12f07c62a571cbe870b550be97 (diff) | |
download | lombok-045638ec1f79f68747f135061d2e026faa719642.tar.gz lombok-045638ec1f79f68747f135061d2e026faa719642.tar.bz2 lombok-045638ec1f79f68747f135061d2e026faa719642.zip |
Generate correct hashCode when callSuper and no fields included. Fixes #1505
Diffstat (limited to 'test/transform/resource/after-delombok')
5 files changed, 5 insertions, 12 deletions
diff --git a/test/transform/resource/after-delombok/DataPlain.java b/test/transform/resource/after-delombok/DataPlain.java index 6d109653..b4178878 100644 --- a/test/transform/resource/after-delombok/DataPlain.java +++ b/test/transform/resource/after-delombok/DataPlain.java @@ -217,8 +217,7 @@ final class Data4 extends java.util.Timer { @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); result = result * PRIME + this.getX(); return result; } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCode.java b/test/transform/resource/after-delombok/EqualsAndHashCode.java index 67e07d7f..dbb4f151 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCode.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCode.java @@ -125,9 +125,7 @@ class EqualsAndHashCode4 extends EqualsAndHashCode { @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); return result; } } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java b/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java index 333b6b58..9ba32222 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java @@ -70,8 +70,7 @@ class EqualsAndHashCodeConfigKeys2 extends EqualsAndHashCodeConfigKeys2Parent { @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); result = result * PRIME + this.x; return result; } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java index d9e4a913..ea7d504b 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java @@ -32,8 +32,7 @@ final class EqualsAndHashCodeWithExistingMethods3 extends EqualsAndHashCodeWithE @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); result = result * PRIME + this.x; return result; } diff --git a/test/transform/resource/after-delombok/ValueCallSuper.java b/test/transform/resource/after-delombok/ValueCallSuper.java index e0065885..6214e64f 100644 --- a/test/transform/resource/after-delombok/ValueCallSuper.java +++ b/test/transform/resource/after-delombok/ValueCallSuper.java @@ -25,9 +25,7 @@ final class ValueCallSuper extends ValueParent { @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); return result; } @java.lang.Override |