From 60f575496b3184c2279e9dba470097ed164d5adf Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sat, 29 May 2021 18:49:05 +0200 Subject: [fixes #2838] Handle anonymous classes properly Generated qualified names (e.g. Outer.Inner) now stop at anonymous classes instead of adding an empty part. All handlers that add static fields/methods/types now add error messages instead of generating invalid code. --- .../after-ecj/AccessorsInAnonymousClass.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/transform/resource/after-ecj/AccessorsInAnonymousClass.java (limited to 'test/transform/resource/after-ecj/AccessorsInAnonymousClass.java') diff --git a/test/transform/resource/after-ecj/AccessorsInAnonymousClass.java b/test/transform/resource/after-ecj/AccessorsInAnonymousClass.java new file mode 100644 index 00000000..34db4f2d --- /dev/null +++ b/test/transform/resource/after-ecj/AccessorsInAnonymousClass.java @@ -0,0 +1,29 @@ +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; +public class AccessorsInAnonymousClass { + Object annonymous = new Object() { + @Getter @Setter @Accessors(fluent = true) class Inner { + private String string; + Inner() { + super(); + } + public @java.lang.SuppressWarnings("all") String string() { + return this.string; + } + /** + * @return {@code this}. + */ + public @java.lang.SuppressWarnings("all") Inner string(final String string) { + this.string = string; + return this; + } + } + x() { + super(); + } + }; + public AccessorsInAnonymousClass() { + super(); + } +} -- cgit