From af3226ffaaf1277a217fc8c9fbe3c1259a561c78 Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Thu, 10 Jan 2019 05:28:51 +0100 Subject: Pull overloaded createConstructBuilderVarIfNeeded up to JavacSingularizer --- src/core/lombok/javac/handlers/JavacSingularsRecipes.java | 2 ++ src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java | 3 ++- .../javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java | 3 ++- .../lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/core/lombok/javac') diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java index 69eaf97c..59f38ff2 100644 --- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java +++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java @@ -296,6 +296,8 @@ public class JavacSingularsRecipes { protected abstract void generatePluralMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent); + protected abstract JCStatement createConstructBuilderVarIfNeeded(JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source); + public abstract void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer statements, Name targetVariableName, String builderVariable); public boolean requiresCleaning() { diff --git a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java index 96a40090..425510c2 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java @@ -178,7 +178,8 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { JCStatement jcs = maker.VarDef(maker.Modifiers(0), data.getPluralName(), varType, init); statements.append(jcs); } - + + @Override protected JCStatement createConstructBuilderVarIfNeeded(JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source) { List jceBlank = List.nil(); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index 2ae4b32b..115bb7f7 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -133,7 +133,8 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize return chainDots(builderType, "java", "util", "Collection"); } - private JCStatement createConstructBuilderVarIfNeeded(JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source) { + @Override + protected JCStatement createConstructBuilderVarIfNeeded(JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source) { return createConstructBuilderVarIfNeeded(maker, data, builderType, false, source); } diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index d92923c1..4a03961c 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -180,7 +180,8 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { return chainDots(builderType, "java", "util", "Map"); } - private JCStatement createConstructBuilderVarIfNeeded(JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source) { + @Override + protected JCStatement createConstructBuilderVarIfNeeded(JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source) { return createConstructBuilderVarIfNeeded(maker, data, builderType, true, source); } -- cgit