diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-05-06 22:09:13 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-05-06 22:09:13 +0200 |
commit | f98bf919cc6701e98087d39fefb7bbfc85688834 (patch) | |
tree | eae8f7209e1e26d313747ab7e1ae7bee185609c0 /test/transform/resource/before/EqualsAndHashCodeWithSomeExistingMethods.java | |
parent | 2e27817ca743858c7188128f96c8c32b894ea42e (diff) | |
download | lombok-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.java | 47 |
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; +} + |