use of org.autorefactor.refactoring.ASTHelper.NodeStartPositionComparator in project AutoRefactor by JnRouvignac.
the class RemoveSemiColonRefactoring method filterCommentsInRange.
private List<Comment> filterCommentsInRange(int start, int end, List<Comment> commentList) {
if (commentList.isEmpty()) {
return Collections.emptyList();
}
final List<Comment> comments = new ArrayList<Comment>(commentList);
Collections.sort(comments, new NodeStartPositionComparator());
final Iterator<Comment> it = comments.iterator();
while (it.hasNext()) {
final Comment comment = it.next();
if (comment.getStartPosition() < start || getEndPosition(comment) > end) {
it.remove();
}
}
return comments;
}
Aggregations