From f540335ef972d84f02efba6dcaf608aec0e19129 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 17 Apr 2018 04:19:37 +0200 Subject: [Fixes #1656] Lombok would silently do the wrong thing when using references to `public static final String` fields, instead of actual string literals, there where you can specify strings in lombok annotation parameters, such as `@ToString(of = MyClass.CONSTANT_FIELD)`. We can’t really fix it, but at least now lombok will error when you do that and describe in detail what’s going wrong. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transform/resource/before/ToStringWithConstantRefInOf.java | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/transform/resource/before/ToStringWithConstantRefInOf.java (limited to 'test/transform/resource/before') diff --git a/test/transform/resource/before/ToStringWithConstantRefInOf.java b/test/transform/resource/before/ToStringWithConstantRefInOf.java new file mode 100644 index 00000000..6246dcaf --- /dev/null +++ b/test/transform/resource/before/ToStringWithConstantRefInOf.java @@ -0,0 +1,10 @@ +//skip compare contents +import lombok.ToString; + +@ToString(of = ToStringWithConstantRefInOf.FIELD_NAME) +public class ToStringWithConstantRefInOf { + static final String FIELD_NAME = "id"; + private String id; + private int whatever; +} + -- cgit