aboutsummaryrefslogtreecommitdiff
path: root/test/transform
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2017-11-06 23:45:52 +0100
committerRoel Spilker <r.spilker@gmail.com>2017-11-06 23:46:09 +0100
commit045638ec1f79f68747f135061d2e026faa719642 (patch)
treedebabf20d4cb9af4c8c6ed20d6044744c537705f /test/transform
parent7fad34b0a6fbda12f07c62a571cbe870b550be97 (diff)
downloadlombok-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')
-rw-r--r--test/transform/resource/after-delombok/DataPlain.java3
-rw-r--r--test/transform/resource/after-delombok/EqualsAndHashCode.java4
-rw-r--r--test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java3
-rw-r--r--test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java3
-rw-r--r--test/transform/resource/after-delombok/ValueCallSuper.java4
-rw-r--r--test/transform/resource/after-ecj/DataPlain.java3
-rw-r--r--test/transform/resource/after-ecj/EqualsAndHashCode.java4
-rw-r--r--test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java3
-rw-r--r--test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java3
-rw-r--r--test/transform/resource/after-ecj/ValueCallSuper.java4
10 files changed, 10 insertions, 24 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
diff --git a/test/transform/resource/after-ecj/DataPlain.java b/test/transform/resource/after-ecj/DataPlain.java
index ba6c75c8..125d1dfa 100644
--- a/test/transform/resource/after-ecj/DataPlain.java
+++ b/test/transform/resource/after-ecj/DataPlain.java
@@ -168,8 +168,7 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java
}
public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") 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-ecj/EqualsAndHashCode.java b/test/transform/resource/after-ecj/EqualsAndHashCode.java
index c0bb5bbb..74936ff2 100644
--- a/test/transform/resource/after-ecj/EqualsAndHashCode.java
+++ b/test/transform/resource/after-ecj/EqualsAndHashCode.java
@@ -129,9 +129,7 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte
return (other instanceof EqualsAndHashCode4);
}
public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") 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-ecj/EqualsAndHashCodeConfigKeys2.java b/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java
index ff0e45c7..a0cc1046 100644
--- a/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java
+++ b/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java
@@ -66,8 +66,7 @@
}
public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") 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-ecj/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java
index e4efb336..3b12e4e4 100644
--- a/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java
+++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java
@@ -40,8 +40,7 @@ final @lombok.EqualsAndHashCode(callSuper = true) class EqualsAndHashCodeWithExi
}
public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") 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-ecj/ValueCallSuper.java b/test/transform/resource/after-ecj/ValueCallSuper.java
index ecd4a1ef..4e84f42c 100644
--- a/test/transform/resource/after-ecj/ValueCallSuper.java
+++ b/test/transform/resource/after-ecj/ValueCallSuper.java
@@ -20,9 +20,7 @@ final @lombok.Value class ValueCallSuper extends ValueParent {
return (other instanceof ValueCallSuper);
}
public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() {
- final int PRIME = 59;
- int result = 1;
- result = ((result * PRIME) + super.hashCode());
+ int result = super.hashCode();
return result;
}
public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() {