aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2020-07-09 17:49:47 +0200
committerRoel Spilker <r.spilker@gmail.com>2020-07-09 22:04:23 +0200
commit586af27800309b600cf5d505a469bab66375b30d (patch)
tree4960aaf9b668dbee499ba50a16e5679af7d6e335
parent88d4c1e54cb9a7820580fda86fc79aa0b0c54c88 (diff)
downloadlombok-586af27800309b600cf5d505a469bab66375b30d.tar.gz
lombok-586af27800309b600cf5d505a469bab66375b30d.tar.bz2
lombok-586af27800309b600cf5d505a469bab66375b30d.zip
Replace JavacAst list with single object iteration to save some memory
-rw-r--r--src/core/lombok/javac/JavacTransformer.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/core/lombok/javac/JavacTransformer.java b/src/core/lombok/javac/JavacTransformer.java
index 625fb283..b3e7f63b 100644
--- a/src/core/lombok/javac/JavacTransformer.java
+++ b/src/core/lombok/javac/JavacTransformer.java
@@ -21,7 +21,6 @@
*/
package lombok.javac;
-import java.util.ArrayList;
import java.util.SortedSet;
import javax.annotation.processing.Messager;
@@ -68,20 +67,14 @@ public class JavacTransformer {
}
}
- java.util.List<JavacAST> asts = new ArrayList<JavacAST>();
-
for (JCCompilationUnit unit : compilationUnits) {
if (!Boolean.TRUE.equals(LombokConfiguration.read(ConfigurationKeys.LOMBOK_DISABLE, JavacAST.getAbsoluteFileLocation(unit)))) {
- asts.add(new JavacAST(messager, context, unit, cleanup));
+ JavacAST ast = new JavacAST(messager, context, unit, cleanup);
+ ast.traverse(new AnnotationVisitor(priority));
+ handlers.callASTVisitors(ast, priority);
+ if (ast.isChanged()) LombokOptions.markChanged(context, (JCCompilationUnit) ast.top().get());
}
}
-
- for (JavacAST ast : asts) {
- ast.traverse(new AnnotationVisitor(priority));
- handlers.callASTVisitors(ast, priority);
- }
-
- for (JavacAST ast : asts) if (ast.isChanged()) LombokOptions.markChanged(context, (JCCompilationUnit) ast.top().get());
}
private class AnnotationVisitor extends JavacASTAdapter {