@Override
public List<Comment> getComments() {
final List<Comment> comments = new ArrayList<>();
try {
final List<String> specifics = new ArrayList<>();
for (final CommitComment commitComment :
pullRequestService.getComments(
repository, violationCommentsToGitHubApi.getPullRequestId())) {
comments.add(
new Comment(
Long.toString(commitComment.getId()),
commitComment.getBody(),
TYPE_DIFF,
specifics));
}
for (final org.eclipse.egit.github.core.Comment comment :
issueSerivce.getComments(repository, violationCommentsToGitHubApi.getPullRequestId())) {
comments.add(
new Comment(Long.toString(comment.getId()), comment.getBody(), TYPE_PR, specifics));
}
} catch (final Exception e) {
violationsLogger.log(SEVERE, e.getMessage(), e);
}
return comments;
}