diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2021-09-16 02:04:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 02:04:12 +0200 |
commit | 485c3533bb1b84887f17243c258fdf485b8ea15a (patch) | |
tree | e4d0522989907cdeb514e86f125a697fe51009a6 /test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java | |
parent | 602a68b8f8ad0504b2aaf7c939328617dc2f2326 (diff) | |
parent | 0f358d38c5e8dc3253503b081c91458c07f71685 (diff) | |
download | lombok-485c3533bb1b84887f17243c258fdf485b8ea15a.tar.gz lombok-485c3533bb1b84887f17243c258fdf485b8ea15a.tar.bz2 lombok-485c3533bb1b84887f17243c258fdf485b8ea15a.zip |
Merge pull request #2866 from Rawi01/anonymous-inner-class
Handle anonymous classes properly
Diffstat (limited to 'test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java')
-rw-r--r-- | test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java b/test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java new file mode 100644 index 00000000..e66850bb --- /dev/null +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeInAnonymousClass.java @@ -0,0 +1,41 @@ +import lombok.EqualsAndHashCode; +public class EqualsAndHashCodeInAnonymousClass { + Object annonymous = new Object() { + @EqualsAndHashCode class Inner { + private String string; + Inner() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof Inner))) + return false; + final Inner other = (Inner) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + final java.lang.Object this$string = this.string; + final java.lang.Object other$string = other.string; + if (((this$string == null) ? (other$string != null) : (! this$string.equals(other$string)))) + return false; + return true; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof Inner); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + final java.lang.Object $string = this.string; + result = ((result * PRIME) + (($string == null) ? 43 : $string.hashCode())); + return result; + } + } + x() { + super(); + } + }; + public EqualsAndHashCodeInAnonymousClass() { + super(); + } +} |