diff options
author | Emil Lundberg <emil@emlun.se> | 2019-01-10 04:00:09 +0100 |
---|---|---|
committer | Emil Lundberg <emil@emlun.se> | 2019-01-13 02:20:04 +0100 |
commit | 36e6e56a93b783b3847d53e998c8e124475d8053 (patch) | |
tree | 41d7e332c87ee5d807450a09b95fd62b95ac3cef | |
parent | 54d8d4b4313cdaa46f7f9581ee6d4214a1542c20 (diff) | |
download | lombok-36e6e56a93b783b3847d53e998c8e124475d8053.tar.gz lombok-36e6e56a93b783b3847d53e998c8e124475d8053.tar.bz2 lombok-36e6e56a93b783b3847d53e998c8e124475d8053.zip |
Inline single-use variables
-rw-r--r-- | src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java | 3 | ||||
-rw-r--r-- | src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java | 11 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index 3781a67e..935edbc3 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -101,8 +101,7 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize JCModifiers mods = makeMods(maker, builderType, deprecate); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, false, source)); - JCStatement st = generateSingularMethodAddStatement(maker, builderType, data.getSingularName(), data.getPluralName().toString()); - statements.append(st); + statements.append(generateSingularMethodAddStatement(maker, builderType, data.getSingularName(), data.getPluralName().toString())); if (returnStatement != null) statements.append(returnStatement); JCBlock body = maker.Block(0, statements.toList()); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index 16b5f1a0..f9a95095 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -131,14 +131,9 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, true, source)); Name keyName = builderType.toName(data.getSingularName().toString() + "Key"); Name valueName = builderType.toName(data.getSingularName().toString() + "Value"); - /* this.pluralname$key.add(singularnameKey); */ { - JCStatement st = generateSingularMethodAddStatement(maker, builderType, keyName, data.getPluralName() + "$key"); - statements.append(st); - } - /* this.pluralname$value.add(singularnameValue); */ { - JCStatement st = generateSingularMethodAddStatement(maker, builderType, valueName, data.getPluralName() + "$value"); - statements.append(st); - } + statements.append(generateSingularMethodAddStatement(maker, builderType, keyName, data.getPluralName() + "$key")); + statements.append(generateSingularMethodAddStatement(maker, builderType, valueName, data.getPluralName() + "$value")); + if (returnStatement != null) statements.append(returnStatement); JCBlock body = maker.Block(0, statements.toList()); |