From 3d0beec38d8d19e8c90df56d7f4297d1c5f332ee Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 29 Jan 2019 01:33:40 +0100 Subject: [fixes #2011] If you have a field named `build` or `toString`, and you generate a builder, that builder wouldn’t make the build or toString methods because it thinks the builder-setter methods it just generated that so happen to have that name indicate you don’t want lombok to do that. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You really shouldn’t name any fields builder or toString, though. --- .../resource/after-ecj/BuilderWithBadNames.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/transform/resource/after-ecj/BuilderWithBadNames.java (limited to 'test/transform/resource/after-ecj') diff --git a/test/transform/resource/after-ecj/BuilderWithBadNames.java b/test/transform/resource/after-ecj/BuilderWithBadNames.java new file mode 100644 index 00000000..a31b2f16 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderWithBadNames.java @@ -0,0 +1,33 @@ +public @lombok.Builder class BuilderWithBadNames { + public static @java.lang.SuppressWarnings("all") class BuilderWithBadNamesBuilder { + private @java.lang.SuppressWarnings("all") String build; + private @java.lang.SuppressWarnings("all") String toString; + @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder build(final String build) { + this.build = build; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder toString(final String toString) { + this.toString = toString; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderWithBadNames build() { + return new BuilderWithBadNames(build, toString); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((("BuilderWithBadNames.BuilderWithBadNamesBuilder(build=" + this.build) + ", toString=") + this.toString) + ")"); + } + } + String build; + String toString; + @java.lang.SuppressWarnings("all") BuilderWithBadNames(final String build, final String toString) { + super(); + this.build = build; + this.toString = toString; + } + public static @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder builder() { + return new BuilderWithBadNamesBuilder(); + } +} -- cgit