diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2021-02-04 22:02:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 22:02:30 +0100 |
commit | ccae25ac8c9b3a134a817eb2164d80a5b50322e8 (patch) | |
tree | a44d22233dda4612bd1ae083b4310cfbf7e061ee /test | |
parent | 011e9915f2fbfa2d0ca9fea816003f90ce59ba5f (diff) | |
parent | 191a8011ef5e8ae2a4446b9b357e121272526364 (diff) | |
download | lombok-ccae25ac8c9b3a134a817eb2164d80a5b50322e8.tar.gz lombok-ccae25ac8c9b3a134a817eb2164d80a5b50322e8.tar.bz2 lombok-ccae25ac8c9b3a134a817eb2164d80a5b50322e8.zip |
Merge pull request #2734 from Rawi01/data-equals-warning
Only show super()-warning if lombok generates a method
Diffstat (limited to 'test')
3 files changed, 68 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/DataWithOverrideEqualsAndHashCode.java b/test/transform/resource/after-delombok/DataWithOverrideEqualsAndHashCode.java new file mode 100644 index 00000000..7e84dda4 --- /dev/null +++ b/test/transform/resource/after-delombok/DataWithOverrideEqualsAndHashCode.java @@ -0,0 +1,25 @@ +class DataWithOverrideEqualsAndHashCode { + + class Data1 { + } + + class Data2 extends Data1 { + public int hashCode() { + return 42; + } + + public boolean equals(Object other) { + return false; + } + + @java.lang.SuppressWarnings("all") + public Data2() { + } + + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "DataWithOverrideEqualsAndHashCode.Data2()"; + } + } +} diff --git a/test/transform/resource/after-ecj/DataWithOverrideEqualsAndHashCode.java b/test/transform/resource/after-ecj/DataWithOverrideEqualsAndHashCode.java new file mode 100644 index 00000000..2149321f --- /dev/null +++ b/test/transform/resource/after-ecj/DataWithOverrideEqualsAndHashCode.java @@ -0,0 +1,25 @@ +import lombok.Data; +class DataWithOverrideEqualsAndHashCode { + class Data1 { + Data1() { + super(); + } + } + @Data class Data2 extends Data1 { + public int hashCode() { + return 42; + } + public boolean equals(Object other) { + return false; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return "DataWithOverrideEqualsAndHashCode.Data2()"; + } + public @java.lang.SuppressWarnings("all") Data2() { + super(); + } + } + DataWithOverrideEqualsAndHashCode() { + super(); + } +} diff --git a/test/transform/resource/before/DataWithOverrideEqualsAndHashCode.java b/test/transform/resource/before/DataWithOverrideEqualsAndHashCode.java new file mode 100644 index 00000000..78138bbf --- /dev/null +++ b/test/transform/resource/before/DataWithOverrideEqualsAndHashCode.java @@ -0,0 +1,18 @@ +import lombok.Data; + +class DataWithOverrideEqualsAndHashCode { + class Data1 { + + } + + @Data + class Data2 extends Data1 { + public int hashCode() { + return 42; + } + + public boolean equals(Object other) { + return false; + } + } +}
\ No newline at end of file |