From 46b71c810ce3ee52b1e00f63e21aa5c5d3fb5ca6 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 19 Feb 2019 00:09:03 +0100 Subject: [issue #2039] update docs to warn about a javac peculiarity for named static imports. --- website/templates/features/Builder.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'website/templates/features/Builder.html') diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html index 793c7b54..082b97ed 100644 --- a/website/templates/features/Builder.html +++ b/website/templates/features/Builder.html @@ -183,6 +183,8 @@ public class JacksonExample { The initializer on a @Builder.Default field is removed and stored in a static method, in order to guarantee that this initializer won't be executed at all if a value is specified in the build. This does mean the initializer cannot refer to this, super or any non-static member. If lombok generates a constructor for you, it'll also initialize this field with the initializer.

Various well known annotations about nullity cause null checks to be inserted and will be copied to parameter of the builder's 'setter' method. See Getter/Setter documentation's small print for more information. +

+ Due to a peculiar way javac processes static imports, trying to do a non-star static import of the static builder() method won't work. Either use a star static import: `import static TypeThatHasABuilder.*;` or don't statically import the builder method.

-- cgit