From 8b8a7eb76e626b09c8a59c593ae033ddf258184b Mon Sep 17 00:00:00 2001 From: traceyyoshima Date: Wed, 1 Nov 2023 13:16:19 -0600 Subject: [PATCH] Polish --- .../kotlin/cleanup/ImplicitParameterInLambda.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openrewrite/kotlin/cleanup/ImplicitParameterInLambda.java b/src/main/java/org/openrewrite/kotlin/cleanup/ImplicitParameterInLambda.java index 3c3b80f59..1ed972402 100644 --- a/src/main/java/org/openrewrite/kotlin/cleanup/ImplicitParameterInLambda.java +++ b/src/main/java/org/openrewrite/kotlin/cleanup/ImplicitParameterInLambda.java @@ -24,10 +24,11 @@ import org.openrewrite.kotlin.KotlinVisitor; import java.time.Duration; -import java.util.ArrayList; import java.util.Collections; import java.util.Set; +import static java.util.Collections.emptyList; + @Value @EqualsAndHashCode(callSuper = true) @@ -63,7 +64,7 @@ public TreeVisitor getVisitor() { public J visitLambda(J.Lambda lambda, ExecutionContext executionContext) { lambda = (J.Lambda) super.visitLambda(lambda, executionContext); if (isParameterExplicitIt(lambda)) { - lambda = lambda.withParameters(lambda.getParameters().withParameters(new ArrayList<>())); + lambda = lambda.withParameters(lambda.getParameters().withParameters(emptyList())); } return lambda; }