diff options
author | Emil Lundberg <emil@emlun.se> | 2019-01-10 05:59:25 +0100 |
---|---|---|
committer | Emil Lundberg <emil@emlun.se> | 2019-01-13 02:38:11 +0100 |
commit | 07e4a3d4cac3e173d61ae49b267e7a87939d9104 (patch) | |
tree | e95e504792b732b1cf354248128ab94764cb0cb8 /src/core/lombok | |
parent | 691c855b8962ef78d38ebb6851f5a74b500beab4 (diff) | |
download | lombok-07e4a3d4cac3e173d61ae49b267e7a87939d9104.tar.gz lombok-07e4a3d4cac3e173d61ae49b267e7a87939d9104.tar.bz2 lombok-07e4a3d4cac3e173d61ae49b267e7a87939d9104.zip |
Move return statement addition statement to just before finishAndInjectMethod call
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/javac/handlers/JavacSingularsRecipes.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java index 5f6c4784..d8b53ab5 100644 --- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java +++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java @@ -255,9 +255,9 @@ public class JavacSingularsRecipes { JCStatement clearStatement = generateClearStatements(maker, data, builderType); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.add(clearStatement); - if (returnStatement != null) statements.append(returnStatement); Name methodName = builderType.toName(HandlerUtil.buildAccessorName("clear", data.getPluralName().toString())); + if (returnStatement != null) statements.append(returnStatement); finishAndInjectMethod(maker, returnType, builderType, source, deprecate, statements, methodName, List.<JCVariableDecl>nil()); } @@ -266,10 +266,10 @@ public class JavacSingularsRecipes { void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { ListBuffer<JCStatement> statements = generateSingularMethodStatements(maker, data, builderType, source); List<JCVariableDecl> params = generateSingularMethodParameters(maker, data, builderType, source); - if (returnStatement != null) statements.append(returnStatement); Name name = data.getSingularName(); if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName(getAddMethodName(), name.toString())); + if (returnStatement != null) statements.append(returnStatement); finishAndInjectMethod(maker, returnType, builderType, source, deprecate, statements, name, params); } @@ -294,13 +294,13 @@ public class JavacSingularsRecipes { void generatePluralMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { ListBuffer<JCStatement> statements = generatePluralMethodStatements(maker, data, builderType, source); - if (returnStatement != null) statements.append(returnStatement); Name name = data.getPluralName(); if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName(getAddMethodName() + "All", name.toString())); JCExpression paramType = getPluralMethodParamType(builderType); paramType = addTypeArgs(getTypeArgumentsCount(), true, builderType, paramType, data.getTypeArgs(), source); long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null); + if (returnStatement != null) statements.append(returnStatement); finishAndInjectMethod(maker, returnType, builderType, source, deprecate, statements, name, List.of(param)); } |