diff options
author | Emil Lundberg <emil@emlun.se> | 2019-01-10 03:31:46 +0100 |
---|---|---|
committer | Emil Lundberg <emil@emlun.se> | 2019-01-13 02:20:03 +0100 |
commit | 2747ce6a2ca3ae5b06cc8fdbd1c2c8607c515858 (patch) | |
tree | b0b7a88f34db7eab9d5c36780cdee56dc543d067 /src/core/lombok | |
parent | a367f7815dcf7a818e3494929e3d005e06c2efb1 (diff) | |
download | lombok-2747ce6a2ca3ae5b06cc8fdbd1c2c8607c515858.tar.gz lombok-2747ce6a2ca3ae5b06cc8fdbd1c2c8607c515858.tar.bz2 lombok-2747ce6a2ca3ae5b06cc8fdbd1c2c8607c515858.zip |
Move invariant parameter inside generateSingularMethodParameter
Diffstat (limited to 'src/core/lombok')
4 files changed, 6 insertions, 8 deletions
diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java index d8dc65c7..b2bcf091 100644 --- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java +++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java @@ -266,7 +266,8 @@ public class JavacSingularsRecipes { protected abstract void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent); - protected JCVariableDecl generateSingularMethodParameter(int typeIndex, JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source, Name name, long flags) { + protected JCVariableDecl generateSingularMethodParameter(int typeIndex, JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source, Name name) { + long flags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); JCExpression type = cloneParamType(typeIndex, maker, data.getTypeArgs(), builderType, source); List<JCAnnotation> typeUseAnns = getTypeUseAnnotations(type); type = removeTypeUseAnnotations(type); diff --git a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java index 73b1a456..971738c7 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java @@ -107,8 +107,7 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { if (!fluent) methodName = builderType.toName(HandlerUtil.buildAccessorName(getAddMethodName(), methodName.toString())); ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>(); for (int i = 0; i < suffixes.size(); i++) { - long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); - params.append(generateSingularMethodParameter(i, maker, data, builderType, source, names[i], paramFlags)); + params.append(generateSingularMethodParameter(i, maker, data, builderType, source, names[i])); } finishAndInjectMethod(maker, returnType, builderType, source, mods, body, methodName, params.toList()); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index d6c0a02d..955dfef0 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -110,8 +110,7 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("add", name.toString())); Name paramName = data.getSingularName(); - long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); - JCVariableDecl param = generateSingularMethodParameter(0, maker, data, builderType, source, paramName, paramFlags); + JCVariableDecl param = generateSingularMethodParameter(0, maker, data, builderType, source, paramName); finishAndInjectMethod(maker, returnType, builderType, source, mods, body, name, List.of(param)); } diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index a936f117..346fe5d7 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -148,9 +148,8 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { Name name = data.getSingularName(); if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("put", name.toString())); - long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); - JCVariableDecl paramKey = generateSingularMethodParameter(0, maker, data, builderType, source, keyName, paramFlags); - JCVariableDecl paramValue = generateSingularMethodParameter(1, maker, data, builderType, source, valueName, paramFlags); + JCVariableDecl paramKey = generateSingularMethodParameter(0, maker, data, builderType, source, keyName); + JCVariableDecl paramValue = generateSingularMethodParameter(1, maker, data, builderType, source, valueName); finishAndInjectMethod(maker, returnType, builderType, source, mods, body, name, List.of(paramKey, paramValue)); } |