mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-28 06:21:43 +00:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user