aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmil Lundberg <emil@emlun.se>2019-01-10 04:31:57 +0100
committerEmil Lundberg <emil@emlun.se>2019-01-13 02:25:26 +0100
commit223a3fdb97ce67247b03a2537f53600fa6f2c383 (patch)
treec3f379bba421e592748b96ec5075dd6b83eaf3d7 /src
parent73a70e3332230170a11657610417f6d62a269643 (diff)
downloadlombok-223a3fdb97ce67247b03a2537f53600fa6f2c383.tar.gz
lombok-223a3fdb97ce67247b03a2537f53600fa6f2c383.tar.bz2
lombok-223a3fdb97ce67247b03a2537f53600fa6f2c383.zip
Uae names.length instead of suffixes.size() as loop limits
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java
index 9d5264c4..d3db63ff 100644
--- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java
+++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java
@@ -84,17 +84,17 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer {
protected void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) {
LombokImmutableList<String> suffixes = getArgumentSuffixes();
Name[] names = new Name[suffixes.size()];
- for (int i = 0; i < suffixes.size(); i++) {
+ for (int i = 0; i < names.length; i++) {
String s = suffixes.get(i);
Name n = data.getSingularName();
names[i] = s.isEmpty() ? n : builderType.toName(s);
}
-
+
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, source));
JCExpression thisDotFieldDotAdd = chainDots(builderType, "this", data.getPluralName().toString(), getAddMethodName());
ListBuffer<JCExpression> invokeAddExprBuilder = new ListBuffer<JCExpression>();
- for (int i = 0; i < suffixes.size(); i++) {
+ for (int i = 0; i < names.length; i++) {
invokeAddExprBuilder.append(maker.Ident(names[i]));
}
List<JCExpression> invokeAddExpr = invokeAddExprBuilder.toList();
@@ -103,7 +103,7 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer {
statements.append(st);
ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>();
- for (int i = 0; i < suffixes.size(); i++) {
+ for (int i = 0; i < names.length; i++) {
params.append(generateSingularMethodParameter(i, maker, data, builderType, source, names[i]));
}