aboutsummaryrefslogtreecommitdiff
path: root/src/delombok/lombok
diff options
context:
space:
mode:
Diffstat (limited to 'src/delombok/lombok')
-rw-r--r--src/delombok/lombok/delombok/DelombokResult.java12
-rw-r--r--src/delombok/lombok/delombok/PrettyCommentsPrinter.java16
2 files changed, 14 insertions, 14 deletions
diff --git a/src/delombok/lombok/delombok/DelombokResult.java b/src/delombok/lombok/delombok/DelombokResult.java
index 0ed39607..6fd62bf6 100644
--- a/src/delombok/lombok/delombok/DelombokResult.java
+++ b/src/delombok/lombok/delombok/DelombokResult.java
@@ -27,16 +27,16 @@ import java.util.List;
import javax.tools.JavaFileObject;
-import lombok.javac.Comment;
+import lombok.javac.CommentInfo;
import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
public class DelombokResult {
- private final List<Comment> comments;
+ private final List<CommentInfo> comments;
private final JCCompilationUnit compilationUnit;
private final boolean changed;
- public DelombokResult(List<Comment> comments, JCCompilationUnit compilationUnit, boolean changed) {
+ public DelombokResult(List<CommentInfo> comments, JCCompilationUnit compilationUnit, boolean changed) {
this.comments = comments;
this.compilationUnit = compilationUnit;
this.changed = changed;
@@ -55,9 +55,9 @@ public class DelombokResult {
out.write(String.valueOf(new Date()));
out.write(System.getProperty("line.separator"));
- com.sun.tools.javac.util.List<Comment> comments_;
- if (comments instanceof com.sun.tools.javac.util.List) comments_ = (com.sun.tools.javac.util.List<Comment>) comments;
- else comments_ = com.sun.tools.javac.util.List.from(comments.toArray(new Comment[0]));
+ com.sun.tools.javac.util.List<CommentInfo> comments_;
+ if (comments instanceof com.sun.tools.javac.util.List) comments_ = (com.sun.tools.javac.util.List<CommentInfo>) comments;
+ else comments_ = com.sun.tools.javac.util.List.from(comments.toArray(new CommentInfo[0]));
compilationUnit.accept(new PrettyCommentsPrinter(out, compilationUnit, comments_));
}
diff --git a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
index 387938c6..9b3b7eb8 100644
--- a/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
+++ b/src/delombok/lombok/delombok/PrettyCommentsPrinter.java
@@ -39,10 +39,10 @@ import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
-import lombok.javac.Comment;
+import lombok.javac.CommentInfo;
import lombok.javac.Javac;
-import lombok.javac.Comment.EndConnection;
-import lombok.javac.Comment.StartConnection;
+import lombok.javac.CommentInfo.EndConnection;
+import lombok.javac.CommentInfo.StartConnection;
import com.sun.source.tree.Tree;
import com.sun.tools.javac.code.BoundKind;
@@ -199,7 +199,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
}
}
- private List<Comment> comments;
+ private List<CommentInfo> comments;
private final JCCompilationUnit cu;
private boolean onNewLine = true;
private boolean aligned = false;
@@ -209,7 +209,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
private boolean needsNewLine = false;
private boolean needsAlign = false;
- public PrettyCommentsPrinter(Writer out, JCCompilationUnit cu, List<Comment> comments) {
+ public PrettyCommentsPrinter(Writer out, JCCompilationUnit cu, List<CommentInfo> comments) {
this.out = out;
this.comments = comments;
this.cu = cu;
@@ -222,7 +222,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
private void consumeComments(int till) throws IOException {
boolean prevNewLine = onNewLine;
boolean found = false;
- Comment head = comments.head;
+ CommentInfo head = comments.head;
while (comments.nonEmpty() && head.pos < till) {
printComment(head);
comments = comments.tail;
@@ -235,7 +235,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
private void consumeTrailingComments(int from) throws IOException {
boolean prevNewLine = onNewLine;
- Comment head = comments.head;
+ CommentInfo head = comments.head;
boolean stop = false;
while (comments.nonEmpty() && head.prevEndPos == from && !stop && !(head.start == StartConnection.ON_NEXT_LINE || head.start == StartConnection.START_OF_LINE)) {
from = head.endPos;
@@ -249,7 +249,7 @@ public class PrettyCommentsPrinter extends JCTree.Visitor {
}
}
- private void printComment(Comment comment) throws IOException {
+ private void printComment(CommentInfo comment) throws IOException {
prepareComment(comment.start);
print(comment.content);
switch (comment.end) {