aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2022-05-19 22:59:30 +0200
committerRawi01 <Rawi01@users.noreply.github.com>2022-05-20 00:08:05 +0200
commit59717d0c95d62b0b1bedd49ac4a047663a55da22 (patch)
tree05021e6575f7974f21ec4ab27bc381277a58a500 /src/core/lombok
parent1473389f397579a224d57b496f6387f3b8cbb6a9 (diff)
downloadlombok-59717d0c95d62b0b1bedd49ac4a047663a55da22.tar.gz
lombok-59717d0c95d62b0b1bedd49ac4a047663a55da22.tar.bz2
lombok-59717d0c95d62b0b1bedd49ac4a047663a55da22.zip
[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.
Diffstat (limited to 'src/core/lombok')
-rwxr-xr-xsrc/core/lombok/eclipse/handlers/HandleBuilder.java2
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSuperBuilder.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java
index a2dd5057..bb9b6dda 100755
--- a/src/core/lombok/eclipse/handlers/HandleBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java
@@ -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);
diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
index 558c6ec2..0d327d5f 100644
--- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
@@ -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);