mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 06:16:14 +00:00
[fixes #3181] Copy field name arrays in (Super)Builder
The eclipse SelectionEngine uses the identity, finds the field in the builder and gets confused by the wrong source positions. If we clone the array it only finds the correct field and it works as expected.
This commit is contained in:
1 parent
1473389f39
commit
59717d0c95
2 files changed
+2
-2
No files matched your search
@@ -983,7 +983,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> {
|
||||
}
|
||||
|
||||
if (field == null) {
|
||||
FieldDeclaration fd = new FieldDeclaration(bfd.builderFieldName, 0, 0);
|
||||
FieldDeclaration fd = new FieldDeclaration(bfd.builderFieldName.clone(), 0, 0);
|
||||
fd.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG;
|
||||
fd.modifiers = ClassFileConstants.AccPrivate;
|
||||
fd.type = copyType(bfd.type);
|
||||
|
||||
@@ -948,7 +948,7 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> {
|
||||
}
|
||||
|
||||
if (field == null) {
|
||||
FieldDeclaration fd = new FieldDeclaration(bfd.builderFieldName, 0, 0);
|
||||
FieldDeclaration fd = new FieldDeclaration(bfd.builderFieldName.clone(), 0, 0);
|
||||
fd.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG;
|
||||
fd.modifiers = ClassFileConstants.AccPrivate;
|
||||
fd.type = copyType(bfd.type);
|
||||
|
||||
Reference in new issue
Block a user