aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Lundberg <emil@emlun.se>2019-01-10 02:53:09 +0100
committerEmil Lundberg <emil@emlun.se>2019-01-13 02:13:56 +0100
commitf84349965803816d46473b42d08ed0c0d288ce8a (patch)
tree68eb1686857c4e70bb305ffc4ccebfd1c93cf069
parent360c1d5a21273793ef5c96c21b979501bdebb5c3 (diff)
downloadlombok-f84349965803816d46473b42d08ed0c0d288ce8a.tar.gz
lombok-f84349965803816d46473b42d08ed0c0d288ce8a.tar.bz2
lombok-f84349965803816d46473b42d08ed0c0d288ce8a.zip
Extract local variable paramName
-rw-r--r--src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java
index 1b661bb2..79d5166e 100644
--- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java
+++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java
@@ -111,11 +111,12 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize
Name name = data.getSingularName();
long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext());
if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("add", name.toString()));
+ Name paramName = data.getSingularName();
JCExpression paramType = cloneParamType(0, maker, data.getTypeArgs(), builderType, source);
List<JCAnnotation> typeUseAnns = getTypeUseAnnotations(paramType);
paramType = removeTypeUseAnnotations(paramType);
JCModifiers paramMods = typeUseAnns.isEmpty() ? maker.Modifiers(paramFlags) : maker.Modifiers(paramFlags, typeUseAnns);
- JCVariableDecl param = maker.VarDef(paramMods, data.getSingularName(), paramType, null);
+ JCVariableDecl param = maker.VarDef(paramMods, paramName, paramType, null);
finishAndInjectMethod(maker, returnType, builderType, source, mods, body, name, List.of(param));
}