From 26cc8af4d8b0bc7944b5a7137e9e1c77f2f3cf43 Mon Sep 17 00:00:00 2001 From: Jan Rieke Date: Fri, 12 Mar 2021 09:55:44 +0100 Subject: [fixes #2704] SuperBuilder: avoid NPE on existing constructors --- .../SuperBuilderWithExistingConstuctor.java | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/transform/resource/after-delombok/SuperBuilderWithExistingConstuctor.java (limited to 'test/transform/resource/after-delombok') diff --git a/test/transform/resource/after-delombok/SuperBuilderWithExistingConstuctor.java b/test/transform/resource/after-delombok/SuperBuilderWithExistingConstuctor.java new file mode 100644 index 00000000..c23c24db --- /dev/null +++ b/test/transform/resource/after-delombok/SuperBuilderWithExistingConstuctor.java @@ -0,0 +1,39 @@ +public class SuperBuilderWithExistingConstuctor { + public SuperBuilderWithExistingConstuctor() { + } + @java.lang.SuppressWarnings("all") + public static abstract class SuperBuilderWithExistingConstuctorBuilder> { + @java.lang.SuppressWarnings("all") + protected abstract B self(); + @java.lang.SuppressWarnings("all") + public abstract C build(); + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "SuperBuilderWithExistingConstuctor.SuperBuilderWithExistingConstuctorBuilder()"; + } + } + @java.lang.SuppressWarnings("all") + private static final class SuperBuilderWithExistingConstuctorBuilderImpl extends SuperBuilderWithExistingConstuctor.SuperBuilderWithExistingConstuctorBuilder { + @java.lang.SuppressWarnings("all") + private SuperBuilderWithExistingConstuctorBuilderImpl() { + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + protected SuperBuilderWithExistingConstuctor.SuperBuilderWithExistingConstuctorBuilderImpl self() { + return this; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public SuperBuilderWithExistingConstuctor build() { + return new SuperBuilderWithExistingConstuctor(this); + } + } + @java.lang.SuppressWarnings("all") + protected SuperBuilderWithExistingConstuctor(final SuperBuilderWithExistingConstuctor.SuperBuilderWithExistingConstuctorBuilder b) { + } + @java.lang.SuppressWarnings("all") + public static SuperBuilderWithExistingConstuctor.SuperBuilderWithExistingConstuctorBuilder builder() { + return new SuperBuilderWithExistingConstuctor.SuperBuilderWithExistingConstuctorBuilderImpl(); + } +} \ No newline at end of file -- cgit