diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-20 07:03:07 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-20 07:03:07 +0200 |
commit | 77ff3ca2c3ad9544e242cc0c29817831485eeb0b (patch) | |
tree | 2c21059c65df68aad2bd94f1b28ee12e4aea44c9 /src/core/lombok/javac/handlers/JavacHandlerUtil.java | |
parent | 4e40de2f8816c93805f5deffbe2d2d7ecff3264e (diff) | |
download | lombok-77ff3ca2c3ad9544e242cc0c29817831485eeb0b.tar.gz lombok-77ff3ca2c3ad9544e242cc0c29817831485eeb0b.tar.bz2 lombok-77ff3ca2c3ad9544e242cc0c29817831485eeb0b.zip |
import lombok.AccessLevel is now also removed during delomboking.
Also, when NOT running delombok, the javac processors no longer delete the lombok annotations as they process. This is particularly relevant for netbeans.
This fixes issue #100 and #103.
Diffstat (limited to 'src/core/lombok/javac/handlers/JavacHandlerUtil.java')
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index a4949a58..0df48358 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -92,13 +92,15 @@ public class JavacHandlerUtil { return; } - JCCompilationUnit unit = (JCCompilationUnit) annotation.top().get(); - deleteImportFromCompilationUnit(unit, annotationType.getName()); + deleteImportFromCompilationUnit(annotation, annotationType.getName()); } - private static void deleteImportFromCompilationUnit(JCCompilationUnit unit, String name) { + public static void deleteImportFromCompilationUnit(JavacNode node, String name) { + if (!node.shouldDeleteLombokAnnotations()) return; List<JCTree> newDefs = List.nil(); + JCCompilationUnit unit = (JCCompilationUnit) node.top().get(); + for (JCTree def : unit.defs) { boolean delete = false; if (def instanceof JCImport) { |