diff options
author | Emil Lundberg <emil@emlun.se> | 2019-01-10 03:43:08 +0100 |
---|---|---|
committer | Emil Lundberg <emil@emlun.se> | 2019-01-13 02:20:04 +0100 |
commit | e9f4bcb890ba96f1c31bce01c3ee7c15bf56866f (patch) | |
tree | f52210385560884684a323bae037efd9ccea035a /src | |
parent | 8cec66794357b26f53a773f8dd448b2b3b1fdd72 (diff) | |
download | lombok-e9f4bcb890ba96f1c31bce01c3ee7c15bf56866f.tar.gz lombok-e9f4bcb890ba96f1c31bce01c3ee7c15bf56866f.tar.bz2 lombok-e9f4bcb890ba96f1c31bce01c3ee7c15bf56866f.zip |
Extract local variables
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()); |