aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-05-06 22:09:13 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2013-05-06 22:09:13 +0200
commitf98bf919cc6701e98087d39fefb7bbfc85688834 (patch)
treeeae8f7209e1e26d313747ab7e1ae7bee185609c0 /test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java
parent2e27817ca743858c7188128f96c8c32b894ea42e (diff)
downloadlombok-f98bf919cc6701e98087d39fefb7bbfc85688834.tar.gz
lombok-f98bf919cc6701e98087d39fefb7bbfc85688834.tar.bz2
lombok-f98bf919cc6701e98087d39fefb7bbfc85688834.zip
Fixed issue 513: If equals is present but hashCode isn't, @Data now generates a warning to explain this strange situation.
Diffstat (limited to 'test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java')
-rw-r--r--test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java b/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java
new file mode 100644
index 00000000..784e3b3f
--- /dev/null
+++ b/test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java
@@ -0,0 +1,47 @@
+import lombok.*;
+import static lombok.AccessLevel.NONE;
+
+@Data
+@Getter(NONE)
+@Setter(NONE)
+class EqualsAndHashCodeWithSomeExistingMethods {
+ int x;
+
+ public int hashCode() {
+ return 42;
+ }
+}
+
+@Data
+@Getter(NONE)
+@Setter(NONE)
+class EqualsAndHashCodeWithSomeExistingMethods2 {
+ int x;
+
+ public boolean canEqual(Object other) {
+ return false;
+ }
+}
+
+@Data
+@Getter(NONE)
+@Setter(NONE)
+class EqualsAndHashCodeWithAllExistingMethods {
+ int x;
+
+ public int hashCode() {
+ return 42;
+ }
+
+ public boolean equals(Object other) {
+ return false;
+ }
+}
+
+@Data
+@Getter(AccessLevel.NONE)
+@Setter(lombok.AccessLevel.NONE)
+class EqualsAndHashCodeWithNoExistingMethods {
+ int x;
+}
+