diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-12-12 21:18:24 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-12-12 23:24:58 +0100 |
commit | d713dab0c36889846a7445bf965b567e9b9a7b9b (patch) | |
tree | 78dc912a4fb021810c4fd0aaba018939985f33bb /src/utils/lombok/javac/CommentCatcher.java | |
parent | 3e18007af326e1401282a1f97dded74a4b306726 (diff) | |
download | lombok-d713dab0c36889846a7445bf965b567e9b9a7b9b.tar.gz lombok-d713dab0c36889846a7445bf965b567e9b9a7b9b.tar.bz2 lombok-d713dab0c36889846a7445bf965b567e9b9a7b9b.zip |
Renamed Comment to CommentInfo.
Diffstat (limited to 'src/utils/lombok/javac/CommentCatcher.java')
-rw-r--r-- | src/utils/lombok/javac/CommentCatcher.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/utils/lombok/javac/CommentCatcher.java b/src/utils/lombok/javac/CommentCatcher.java index 3bd64ec7..474dc43d 100644 --- a/src/utils/lombok/javac/CommentCatcher.java +++ b/src/utils/lombok/javac/CommentCatcher.java @@ -21,24 +21,23 @@ */ package lombok.javac; -import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.WeakHashMap; import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.List; public class CommentCatcher { private final JavaCompiler compiler; - private final Map<JCCompilationUnit, List<Comment>> commentsMap; + private final Map<JCCompilationUnit, List<CommentInfo>> commentsMap; public static CommentCatcher create(Context context) { registerCommentsCollectingScannerFactory(context); JavaCompiler compiler = new JavaCompiler(context); - Map<JCCompilationUnit, List<Comment>> commentsMap = new WeakHashMap<JCCompilationUnit, List<Comment>>(); + Map<JCCompilationUnit, List<CommentInfo>> commentsMap = new WeakHashMap<JCCompilationUnit, List<CommentInfo>>(); setInCompiler(compiler, context, commentsMap); compiler.keepComments = true; @@ -47,7 +46,7 @@ public class CommentCatcher { return new CommentCatcher(compiler, commentsMap); } - private CommentCatcher(JavaCompiler compiler, Map<JCCompilationUnit, List<Comment>> commentsMap) { + private CommentCatcher(JavaCompiler compiler, Map<JCCompilationUnit, List<CommentInfo>> commentsMap) { this.compiler = compiler; this.commentsMap = commentsMap; } @@ -56,9 +55,9 @@ public class CommentCatcher { return compiler; } - public List<Comment> getComments(JCCompilationUnit ast) { - List<Comment> list = commentsMap.get(ast); - return list == null ? Collections.<Comment>emptyList() : list; + public List<CommentInfo> getComments(JCCompilationUnit ast) { + List<CommentInfo> list = commentsMap.get(ast); + return list == null ? List.<CommentInfo>nil() : list; } private static void registerCommentsCollectingScannerFactory(Context context) { @@ -74,7 +73,7 @@ public class CommentCatcher { } } - private static void setInCompiler(JavaCompiler compiler, Context context, Map<JCCompilationUnit, List<Comment>> commentsMap) { + private static void setInCompiler(JavaCompiler compiler, Context context, Map<JCCompilationUnit, List<CommentInfo>> commentsMap) { try { if (JavaCompiler.version().startsWith("1.6")) { |