aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleBuilder.java
diff options
context:
space:
mode:
authorabrinkman94 <abrinkman94@gmail.com>2019-09-19 11:30:12 -0500
committerabrinkman94 <abrinkman94@gmail.com>2019-09-19 11:30:12 -0500
commite1bd41fab9d62b5478e50b5c2fe2e45a0d767334 (patch)
treed03b5949d805f9653a3b560bc28197bec3088587 /src/core/lombok/javac/handlers/HandleBuilder.java
parent288ee7be5c98eea9ca60143dde41a50f4a304dca (diff)
downloadlombok-e1bd41fab9d62b5478e50b5c2fe2e45a0d767334.tar.gz
lombok-e1bd41fab9d62b5478e50b5c2fe2e45a0d767334.tar.bz2
lombok-e1bd41fab9d62b5478e50b5c2fe2e45a0d767334.zip
Added setterPrefix to javac
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleBuilder.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleBuilder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java
index da40692e..f199f161 100644
--- a/src/core/lombok/javac/handlers/HandleBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleBuilder.java
@@ -180,7 +180,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
bfd.builderFieldName = bfd.name;
bfd.annotations = findCopyableAnnotations(fieldNode);
bfd.type = fd.vartype;
- bfd.singularData = getSingularData(fieldNode);
+ bfd.singularData = getSingularData(fieldNode, builderInstance.setterPrefix());
bfd.originalFieldNode = fieldNode;
if (bfd.singularData != null && isDefault != null) {
@@ -369,7 +369,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
bfd.rawName = raw.name;
bfd.annotations = findCopyableAnnotations(param);
bfd.type = raw.vartype;
- bfd.singularData = getSingularData(param);
+ bfd.singularData = getSingularData(param, builderInstance.setterPrefix());
bfd.originalFieldNode = param;
addObtainVia(bfd, param);
builderFields.add(bfd);
@@ -876,8 +876,9 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
* or parameter), or null if there's no {@code @Singular} annotation on it.
*
* @param node The node (field or method param) to inspect for its name and potential {@code @Singular} annotation.
+ * @param setterPrefix
*/
- private SingularData getSingularData(JavacNode node) {
+ private SingularData getSingularData(JavacNode node, final String setterPrefix) {
for (JavacNode child : node.down()) {
if (!annotationTypeMatches(Singular.class, child)) continue;
Name pluralName = node.getKind() == Kind.FIELD ? removePrefixFromField(node) : ((JCVariableDecl) node.get()).name;
@@ -919,7 +920,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
return null;
}
- return new SingularData(child, singularName, pluralName, typeArgs, targetFqn, singularizer);
+ return new SingularData(child, singularName, pluralName, typeArgs, targetFqn, singularizer, setterPrefix);
}
return null;