aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
diff options
context:
space:
mode:
authorEmil Lundberg <emil@emlun.se>2019-01-10 03:06:57 +0100
committerEmil Lundberg <emil@emlun.se>2019-01-13 02:19:50 +0100
commit4599a65b7df036eabf5d6784466a0ab848a63d16 (patch)
treea6be1dbc5ac086493b6469d9d1b4ce37cd4d6b92 /src/core/lombok/javac/handlers/JavacSingularsRecipes.java
parent85759a1949fe862a2baa2cb836d0bbea5349db66 (diff)
downloadlombok-4599a65b7df036eabf5d6784466a0ab848a63d16.tar.gz
lombok-4599a65b7df036eabf5d6784466a0ab848a63d16.tar.bz2
lombok-4599a65b7df036eabf5d6784466a0ab848a63d16.zip
Extract method JavacSingularizer.generateSingularMethodParameter
Diffstat (limited to 'src/core/lombok/javac/handlers/JavacSingularsRecipes.java')
-rw-r--r--src/core/lombok/javac/handlers/JavacSingularsRecipes.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
index 9921ba89..d8dc65c7 100644
--- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
+++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java
@@ -266,6 +266,14 @@ public class JavacSingularsRecipes {
protected abstract void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent);
+ protected JCVariableDecl generateSingularMethodParameter(int typeIndex, JavacTreeMaker maker, SingularData data, JavacNode builderType, JCTree source, Name name, long flags) {
+ JCExpression type = cloneParamType(typeIndex, maker, data.getTypeArgs(), builderType, source);
+ List<JCAnnotation> typeUseAnns = getTypeUseAnnotations(type);
+ type = removeTypeUseAnnotations(type);
+ JCModifiers mods = typeUseAnns.isEmpty() ? maker.Modifiers(flags) : maker.Modifiers(flags, typeUseAnns);
+ return maker.VarDef(mods, name, type, null);
+ }
+
protected abstract void generatePluralMethod(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);