diff options
author | Emil Lundberg <emil@emlun.se> | 2019-01-10 05:28:51 +0100 |
---|---|---|
committer | Emil Lundberg <emil@emlun.se> | 2019-01-13 02:27:33 +0100 |
commit | af3226ffaaf1277a217fc8c9fbe3c1259a561c78 (patch) | |
tree | a46f06b08f08cf25cb344f130f289fd224da3083 /src/core/lombok/javac | |
parent | fe11913fa6ecbf3cec06263dcb0fef08a2eb8cce (diff) | |
download | lombok-af3226ffaaf1277a217fc8c9fbe3c1259a561c78.tar.gz lombok-af3226ffaaf1277a217fc8c9fbe3c1259a561c78.tar.bz2 lombok-af3226ffaaf1277a217fc8c9fbe3c1259a561c78.zip |
Pull overloaded createConstructBuilderVarIfNeeded up to JavacSingularizer
Diffstat (limited to 'src/core/lombok/javac')
4 files changed, 8 insertions, 3 deletions
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<JCStatement> 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<JCExpression> 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); } |