aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/BuilderWithBadNames.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-01-29 01:33:40 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-01-29 01:34:22 +0100
commit3d0beec38d8d19e8c90df56d7f4297d1c5f332ee (patch)
tree74f92437acdc3ccfd6a3b5c6f57f596d9216821f /test/transform/resource/after-delombok/BuilderWithBadNames.java
parent960811364b792654cd154787758fbb16f2600f09 (diff)
downloadlombok-3d0beec38d8d19e8c90df56d7f4297d1c5f332ee.tar.gz
lombok-3d0beec38d8d19e8c90df56d7f4297d1c5f332ee.tar.bz2
lombok-3d0beec38d8d19e8c90df56d7f4297d1c5f332ee.zip
[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.
You really shouldn’t name any fields builder or toString, though.
Diffstat (limited to 'test/transform/resource/after-delombok/BuilderWithBadNames.java')
-rw-r--r--test/transform/resource/after-delombok/BuilderWithBadNames.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderWithBadNames.java b/test/transform/resource/after-delombok/BuilderWithBadNames.java
new file mode 100644
index 00000000..f413be23
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderWithBadNames.java
@@ -0,0 +1,42 @@
+public class BuilderWithBadNames {
+ String build;
+ String toString;
+ @java.lang.SuppressWarnings("all")
+ BuilderWithBadNames(final String build, final String toString) {
+ this.build = build;
+ this.toString = toString;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class BuilderWithBadNamesBuilder {
+ @java.lang.SuppressWarnings("all")
+ private String build;
+ @java.lang.SuppressWarnings("all")
+ private String toString;
+ @java.lang.SuppressWarnings("all")
+ BuilderWithBadNamesBuilder() {
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithBadNamesBuilder build(final String build) {
+ this.build = build;
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithBadNamesBuilder toString(final String toString) {
+ this.toString = toString;
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderWithBadNames build() {
+ return new BuilderWithBadNames(build, toString);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderWithBadNames.BuilderWithBadNamesBuilder(build=" + this.build + ", toString=" + this.toString + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static BuilderWithBadNamesBuilder builder() {
+ return new BuilderWithBadNamesBuilder();
+ }
+}