aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/ValueInAnonymousClass.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2021-09-16 02:04:12 +0200
committerGitHub <noreply@github.com>2021-09-16 02:04:12 +0200
commit485c3533bb1b84887f17243c258fdf485b8ea15a (patch)
treee4d0522989907cdeb514e86f125a697fe51009a6 /test/transform/resource/after-delombok/ValueInAnonymousClass.java
parent602a68b8f8ad0504b2aaf7c939328617dc2f2326 (diff)
parent0f358d38c5e8dc3253503b081c91458c07f71685 (diff)
downloadlombok-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-delombok/ValueInAnonymousClass.java')
-rw-r--r--test/transform/resource/after-delombok/ValueInAnonymousClass.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ValueInAnonymousClass.java b/test/transform/resource/after-delombok/ValueInAnonymousClass.java
new file mode 100644
index 00000000..5bab4093
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValueInAnonymousClass.java
@@ -0,0 +1,46 @@
+public class ValueInAnonymousClass {
+ Object annonymous = new Object() {
+
+ final class Inner {
+ private final String string;
+
+ @java.lang.SuppressWarnings("all")
+ public Inner(final String string) {
+ this.string = string;
+ }
+
+ @java.lang.SuppressWarnings("all")
+ public String getString() {
+ return this.string;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Inner)) return false;
+ final Inner other = (Inner) o;
+ final java.lang.Object this$string = this.getString();
+ final java.lang.Object other$string = other.getString();
+ if (this$string == null ? other$string != null : !this$string.equals(other$string)) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ final java.lang.Object $string = this.getString();
+ result = result * PRIME + ($string == null ? 43 : $string.hashCode());
+ return result;
+ }
+
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "Inner(string=" + this.getString() + ")";
+ }
+ }
+ };
+}