diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2020-07-09 18:01:04 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-07-09 22:04:23 +0200 |
commit | ab7970b259336d4e344a7bb11ee9e3d3e2acde5d (patch) | |
tree | 0f5823b0623abb1d9689c914bf76d8c4078746f6 | |
parent | 586af27800309b600cf5d505a469bab66375b30d (diff) | |
download | lombok-ab7970b259336d4e344a7bb11ee9e3d3e2acde5d.tar.gz lombok-ab7970b259336d4e344a7bb11ee9e3d3e2acde5d.tar.bz2 lombok-ab7970b259336d4e344a7bb11ee9e3d3e2acde5d.zip |
Remove unnecessary list copy
-rw-r--r-- | src/core/lombok/javac/JavacTransformer.java | 14 |
1 files 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<JCCompilationUnit> compilationUnitsRaw, CleanupRegistry cleanup) { - List<JCCompilationUnit> compilationUnits; - if (compilationUnitsRaw instanceof List<?>) { - compilationUnits = (List<JCCompilationUnit>) 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<JCCompilationUnit> 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); |