diff options
Diffstat (limited to 'src')
3 files changed, 10 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java index 971738c7..4cd5cf46 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java @@ -100,7 +100,9 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { } List<JCExpression> invokeAddExpr = invokeAddExprBuilder.toList(); JCExpression invokeAdd = maker.Apply(List.<JCExpression>nil(), thisDotFieldDotAdd, invokeAddExpr); - statements.append(maker.Exec(invokeAdd)); + JCStatement st = maker.Exec(invokeAdd); + statements.append(st); + if (returnStatement != null) statements.append(returnStatement); JCBlock body = maker.Block(0, statements.toList()); Name methodName = data.getSingularName(); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index 13418903..f270a375 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -103,7 +103,9 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, false, source)); JCExpression thisDotFieldDotAdd = chainDots(builderType, "this", data.getPluralName().toString(), "add"); JCExpression invokeAdd = maker.Apply(List.<JCExpression>nil(), thisDotFieldDotAdd, List.<JCExpression>of(maker.Ident(data.getSingularName()))); - statements.append(maker.Exec(invokeAdd)); + JCStatement st = maker.Exec(invokeAdd); + statements.append(st); + if (returnStatement != null) statements.append(returnStatement); JCBlock body = maker.Block(0, statements.toList()); Name name = data.getSingularName(); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index 346fe5d7..ad628c5b 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -135,12 +135,14 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { /* this.pluralname$key.add(singularnameKey); */ { JCExpression thisDotKeyFieldDotAdd = chainDots(builderType, "this", data.getPluralName() + "$key", "add"); JCExpression invokeAdd = maker.Apply(List.<JCExpression>nil(), thisDotKeyFieldDotAdd, List.<JCExpression>of(maker.Ident(keyName))); - statements.append(maker.Exec(invokeAdd)); + JCStatement st = maker.Exec(invokeAdd); + statements.append(st); } /* this.pluralname$value.add(singularnameValue); */ { JCExpression thisDotValueFieldDotAdd = chainDots(builderType, "this", data.getPluralName() + "$value", "add"); JCExpression invokeAdd = maker.Apply(List.<JCExpression>nil(), thisDotValueFieldDotAdd, List.<JCExpression>of(maker.Ident(valueName))); - statements.append(maker.Exec(invokeAdd)); + JCStatement st = maker.Exec(invokeAdd); + statements.append(st); } if (returnStatement != null) statements.append(returnStatement); JCBlock body = maker.Block(0, statements.toList()); |