diff options
-rw-r--r-- | src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java | 6 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index e870142c..652e63f3 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -123,7 +123,7 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize Name name = data.getPluralName(); if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("addAll", name.toString())); JCExpression paramType = getPluralMethodParamType(builderType); - paramType = addTypeArgs(1, true, builderType, paramType, data.getTypeArgs(), source); + paramType = addTypeArgs(getTypeArgumentsCount(), true, builderType, paramType, data.getTypeArgs(), source); long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null); finishAndInjectMethod(maker, returnType, builderType, source, deprecate, body, name, List.of(param)); @@ -137,4 +137,8 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize protected String getAddMethodName() { return "add"; } + + private int getTypeArgumentsCount() { + return 1; + } } diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index 94938288..4bef2f1d 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -170,7 +170,7 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { Name name = data.getPluralName(); if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("putAll", name.toString())); JCExpression paramType = getPluralMethodParamType(builderType); - paramType = addTypeArgs(2, true, builderType, paramType, data.getTypeArgs(), source); + paramType = addTypeArgs(getTypeArgumentsCount(), true, builderType, paramType, data.getTypeArgs(), source); long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null); finishAndInjectMethod(maker, returnType, builderType, source, deprecate, body, name, List.of(param)); @@ -199,4 +199,8 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { protected String getAddMethodName() { return "put"; } + + private int getTypeArgumentsCount() { + return 2; + } } |