[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.

This commit is contained in:
Reinier Zwitserloot
2018-04-17 04:19:37 +02:00
parent 7e81ac6238
commit f540335ef9
9 changed files with 87 additions and 40 deletions
@@ -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;
}