From 360c1d5a21273793ef5c96c21b979501bdebb5c3 Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Thu, 10 Jan 2019 02:35:30 +0100 Subject: Move invariant parameters inside finishAndInjectMethod --- .../lombok/javac/handlers/singulars/JavacGuavaSingularizer.java | 8 ++------ .../handlers/singulars/JavacJavaUtilListSetSingularizer.java | 8 ++------ .../javac/handlers/singulars/JavacJavaUtilMapSingularizer.java | 7 ++----- 3 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src/core/lombok/javac/handlers/singulars') diff --git a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java index 9141482f..b514ebd5 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java @@ -117,9 +117,7 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { params.append(p); } - List typeParams = List.nil(); - List thrown = List.nil(); - finishAndInjectMethod(maker, returnType, builderType, source, typeParams, thrown, mods, body, methodName, params.toList()); + finishAndInjectMethod(maker, returnType, builderType, source, mods, body, methodName, params.toList()); } @Override @@ -144,9 +142,7 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { } paramType = addTypeArgs(getTypeArgumentsCount(), true, builderType, paramType, data.getTypeArgs(), source); JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null); - List typeParams = List.nil(); - List thrown = List.nil(); - finishAndInjectMethod(maker, returnType, builderType, source, typeParams, thrown, mods, body, methodName, List.of(param)); + finishAndInjectMethod(maker, returnType, builderType, source, mods, body, methodName, List.of(param)); } @Override public void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer statements, Name targetVariableName, String builderVariable) { diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index ba73d392..1b661bb2 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -116,9 +116,7 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize paramType = removeTypeUseAnnotations(paramType); JCModifiers paramMods = typeUseAnns.isEmpty() ? maker.Modifiers(paramFlags) : maker.Modifiers(paramFlags, typeUseAnns); JCVariableDecl param = maker.VarDef(paramMods, data.getSingularName(), paramType, null); - List typeParams = List.nil(); - List thrown = List.nil(); - finishAndInjectMethod(maker, returnType, builderType, source, typeParams, thrown, mods, body, name, List.of(param)); + finishAndInjectMethod(maker, returnType, builderType, source, mods, body, name, List.of(param)); } @Override @@ -137,8 +135,6 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize JCExpression paramType = chainDots(builderType, "java", "util", "Collection"); paramType = addTypeArgs(1, true, builderType, paramType, data.getTypeArgs(), source); JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null); - List typeParams = List.nil(); - List thrown = List.nil(); - finishAndInjectMethod(maker, returnType, builderType, source, typeParams, thrown, mods, body, name, List.of(param)); + 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 fe0db83e..c7483be6 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -159,9 +159,7 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { JCModifiers paramModsValue = typeUseAnnsValue.isEmpty() ? maker.Modifiers(paramFlags) : maker.Modifiers(paramFlags, typeUseAnnsValue); JCVariableDecl paramKey = maker.VarDef(paramModsKey, keyName, paramTypeKey, null); JCVariableDecl paramValue = maker.VarDef(paramModsValue, valueName, paramTypeValue, null); - List typeParams = List.nil(); - List thrown = List.nil(); - finishAndInjectMethod(maker, returnType, builderType, source, typeParams, thrown, mods, body, name, List.of(paramKey, paramValue)); + finishAndInjectMethod(maker, returnType, builderType, source, mods, body, name, List.of(paramKey, paramValue)); } @Override @@ -192,8 +190,7 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { JCExpression paramType = chainDots(builderType, "java", "util", "Map"); paramType = addTypeArgs(2, true, builderType, paramType, data.getTypeArgs(), source); JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null); - List typeParams = List.nil(); - finishAndInjectMethod(maker, returnType, builderType, source, typeParams, jceBlank, mods, body, name, List.of(param)); + finishAndInjectMethod(maker, returnType, builderType, source, mods, body, name, List.of(param)); } @Override public void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer statements, Name targetVariableName, String builderVariable) { -- cgit