From ab7970b259336d4e344a7bb11ee9e3d3e2acde5d Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 9 Jul 2020 18:01:04 +0200 Subject: Remove unnecessary list copy --- src/core/lombok/javac/JavacTransformer.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/core/lombok/javac/JavacTransformer.java b/src/core/lombok/javac/JavacTransformer.java index b3e7f63b..a2e00680 100644 --- a/src/core/lombok/javac/JavacTransformer.java +++ b/src/core/lombok/javac/JavacTransformer.java @@ -21,6 +21,7 @@ */ package lombok.javac; +import java.util.List; import java.util.SortedSet; import javax.annotation.processing.Messager; @@ -33,7 +34,6 @@ import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.List; import lombok.ConfigurationKeys; import lombok.core.CleanupRegistry; @@ -56,17 +56,7 @@ public class JavacTransformer { return handlers.getPrioritiesRequiringResolutionReset(); } - public void transform(long priority, Context context, java.util.List compilationUnitsRaw, CleanupRegistry cleanup) { - List compilationUnits; - if (compilationUnitsRaw instanceof List) { - compilationUnits = (List) compilationUnitsRaw; - } else { - compilationUnits = List.nil(); - for (int i = compilationUnitsRaw.size() -1; i >= 0; i--) { - compilationUnits = compilationUnits.prepend(compilationUnitsRaw.get(i)); - } - } - + public void transform(long priority, Context context, List compilationUnits, CleanupRegistry cleanup) { for (JCCompilationUnit unit : compilationUnits) { if (!Boolean.TRUE.equals(LombokConfiguration.read(ConfigurationKeys.LOMBOK_DISABLE, JavacAST.getAbsoluteFileLocation(unit)))) { JavacAST ast = new JavacAST(messager, context, unit, cleanup); -- cgit