From d713dab0c36889846a7445bf965b567e9b9a7b9b Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 12 Dec 2011 21:18:24 +0100 Subject: Renamed Comment to CommentInfo. --- src/utils/lombok/javac/CommentCatcher.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/utils/lombok/javac/CommentCatcher.java') 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> commentsMap; + private final Map> commentsMap; public static CommentCatcher create(Context context) { registerCommentsCollectingScannerFactory(context); JavaCompiler compiler = new JavaCompiler(context); - Map> commentsMap = new WeakHashMap>(); + Map> commentsMap = new WeakHashMap>(); setInCompiler(compiler, context, commentsMap); compiler.keepComments = true; @@ -47,7 +46,7 @@ public class CommentCatcher { return new CommentCatcher(compiler, commentsMap); } - private CommentCatcher(JavaCompiler compiler, Map> commentsMap) { + private CommentCatcher(JavaCompiler compiler, Map> commentsMap) { this.compiler = compiler; this.commentsMap = commentsMap; } @@ -56,9 +55,9 @@ public class CommentCatcher { return compiler; } - public List getComments(JCCompilationUnit ast) { - List list = commentsMap.get(ast); - return list == null ? Collections.emptyList() : list; + public List getComments(JCCompilationUnit ast) { + List list = commentsMap.get(ast); + return list == null ? List.nil() : list; } private static void registerCommentsCollectingScannerFactory(Context context) { @@ -74,7 +73,7 @@ public class CommentCatcher { } } - private static void setInCompiler(JavaCompiler compiler, Context context, Map> commentsMap) { + private static void setInCompiler(JavaCompiler compiler, Context context, Map> commentsMap) { try { if (JavaCompiler.version().startsWith("1.6")) { -- cgit