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. --- .../resource/after-delombok/WithByInAnonymousClass.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/transform/resource/after-delombok/WithByInAnonymousClass.java (limited to 'test/transform/resource/after-delombok/WithByInAnonymousClass.java') diff --git a/test/transform/resource/after-delombok/WithByInAnonymousClass.java b/test/transform/resource/after-delombok/WithByInAnonymousClass.java new file mode 100644 index 00000000..e3c70763 --- /dev/null +++ b/test/transform/resource/after-delombok/WithByInAnonymousClass.java @@ -0,0 +1,16 @@ +public class WithByInAnonymousClass { + Object annonymous = new Object() { + + class Inner { + private Inner(String string) { + } + + private String string; + + @java.lang.SuppressWarnings("all") + public Inner withStringBy(final java.util.function.Function transformer) { + return new Inner(transformer.apply(this.string)); + } + } + }; +} -- cgit From 0f358d38c5e8dc3253503b081c91458c07f71685 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sun, 6 Jun 2021 10:39:52 +0200 Subject: [testing] Fix javac6 tests --- test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java | 1 + test/transform/resource/after-delombok/WithByInAnonymousClass.java | 1 + test/transform/resource/before/ConstructorsInAnonymousClass.java | 1 + test/transform/resource/before/WithByInAnonymousClass.java | 1 + 4 files changed, 4 insertions(+) (limited to 'test/transform/resource/after-delombok/WithByInAnonymousClass.java') diff --git a/test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java b/test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java index 56e96ae3..7483718f 100644 --- a/test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java +++ b/test/transform/resource/after-delombok/ConstructorsInAnonymousClass.java @@ -1,3 +1,4 @@ +//version 8: import lombok.NonNull; public class ConstructorsInAnonymousClass { diff --git a/test/transform/resource/after-delombok/WithByInAnonymousClass.java b/test/transform/resource/after-delombok/WithByInAnonymousClass.java index e3c70763..d84955b6 100644 --- a/test/transform/resource/after-delombok/WithByInAnonymousClass.java +++ b/test/transform/resource/after-delombok/WithByInAnonymousClass.java @@ -1,3 +1,4 @@ +//version 8: public class WithByInAnonymousClass { Object annonymous = new Object() { diff --git a/test/transform/resource/before/ConstructorsInAnonymousClass.java b/test/transform/resource/before/ConstructorsInAnonymousClass.java index b6e78dd3..a74a7f11 100644 --- a/test/transform/resource/before/ConstructorsInAnonymousClass.java +++ b/test/transform/resource/before/ConstructorsInAnonymousClass.java @@ -1,3 +1,4 @@ +//version 8: import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.NonNull; diff --git a/test/transform/resource/before/WithByInAnonymousClass.java b/test/transform/resource/before/WithByInAnonymousClass.java index b366f168..afed6adf 100644 --- a/test/transform/resource/before/WithByInAnonymousClass.java +++ b/test/transform/resource/before/WithByInAnonymousClass.java @@ -1,3 +1,4 @@ +//version 8: import lombok.experimental.WithBy; public class WithByInAnonymousClass { -- cgit