diff options
author | Emil Lundberg <emil@emlun.se> | 2019-01-10 01:21:20 +0100 |
---|---|---|
committer | Emil Lundberg <emil@emlun.se> | 2019-01-10 01:21:20 +0100 |
commit | c336e6ff21636b77f8b23ef9c7b64dc94a985248 (patch) | |
tree | 58f59721407af10553215d0fbc9260f4f89add28 /src | |
parent | ccfab5ebffbd14df59689b23ff6f3df52890dca8 (diff) | |
download | lombok-c336e6ff21636b77f8b23ef9c7b64dc94a985248.tar.gz lombok-c336e6ff21636b77f8b23ef9c7b64dc94a985248.tar.bz2 lombok-c336e6ff21636b77f8b23ef9c7b64dc94a985248.zip |
Extract abstract method JavacSingularizer.generateSingularMethod
Diffstat (limited to 'src')
4 files changed, 11 insertions, 6 deletions
diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java index ab8c3a42..19b424cc 100644 --- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java +++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java @@ -230,7 +230,9 @@ public class JavacSingularsRecipes { * Uses the given {@code returnTypeMaker} and {@code returnStatementMaker} for the generated methods. */ public abstract void generateMethods(SingularData data, boolean deprecate, JavacNode builderType, JCTree source, boolean fluent, ExpressionMaker returnTypeMaker, StatementMaker returnStatementMaker); - + + protected abstract void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent); + 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 c5d1b078..a701813b 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java @@ -95,8 +95,9 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { recursiveSetGeneratedBy(method, source, builderType.getContext()); injectMethod(builderType, method); } - - void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + + @Override + protected void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index 96928a4c..74b6ae97 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -110,8 +110,9 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize recursiveSetGeneratedBy(method, source, builderType.getContext()); injectMethod(builderType, method); } - - void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + + @Override + protected void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); JCModifiers mods = makeMods(maker, builderType, deprecate); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index f829eedb..1a25f7e2 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -140,7 +140,8 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { injectMethod(builderType, method); } - private void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + @Override + protected void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); JCModifiers mods = makeMods(maker, builderType, deprecate); |