mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 08:18:29 +00:00
[i1351] Warning on initialized non-final field in Builder was wrong
This commit is contained in:
1 parent
6f4effe84a
commit
7d42d8c620
4 files changed
+4
-4
No files matched your search
@@ -211,7 +211,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
|
||||
|
||||
if (fd.initialization != null && isDefault == null) {
|
||||
if (isFinal) continue;
|
||||
fieldNode.addWarning("@Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. if it is not supposed to be settable during building, add @Builder.Constant.");
|
||||
fieldNode.addWarning("@Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final.");
|
||||
}
|
||||
|
||||
if (isDefault != null) {
|
||||
|
||||
@@ -165,7 +165,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
|
||||
|
||||
if (fd.init != null && isDefault == null) {
|
||||
if (isFinal) continue;
|
||||
fieldNode.addWarning("@Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. if it is not supposed to be settable during building, add @Builder.Constant.");
|
||||
fieldNode.addWarning("@Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final.");
|
||||
}
|
||||
|
||||
if (isDefault != null) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
13 @Builder.Default requires @Builder on the class for it to mean anything.
|
||||
6 @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. if it is not supposed to be settable during building, add @Builder.Constant.
|
||||
6 @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final.
|
||||
8 @Builder.Default requires an initializing expression (' = something;').
|
||||
9 @Builder.Default and @Singular cannot be mixed.
|
||||
@@ -1,4 +1,4 @@
|
||||
6 @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. if it is not supposed to be settable during building, add @Builder.Constant.
|
||||
6 @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final.
|
||||
8 @Builder.Default requires an initializing expression (' = something;').
|
||||
9 @Builder.Default and @Singular cannot be mixed.
|
||||
13 @Builder.Default requires @Builder on the class for it to mean anything.
|
||||
|
||||
Reference in new issue
Block a user