Refactor byChange() into two methods: drafts and published

Callers of the PatchLineCommentUtils.byChange() mostly just want
either the published comments or the drafts comments. For that reason,
I refactored this method into two pieces and updated its callers.

I modified ChangeData.comments() to be ChangeData.publishedComments()
in order to more accurately the contents of the returned list.

Change-Id: I4222b894896af1ae635fd8c390fe014db9f6778d
This commit is contained in:
Yacob Yonas
2014-07-25 17:05:29 -07:00
parent 5020ff2fd0
commit e45d24a2a4
5 changed files with 66 additions and 12 deletions

View File

@@ -408,7 +408,7 @@ public class ChangeField {
public Iterable<String> get(ChangeData input, FillArgs args)
throws OrmException {
Set<String> r = Sets.newHashSet();
for (PatchLineComment c : input.comments()) {
for (PatchLineComment c : input.publishedComments()) {
r.add(c.getMessage());
}
for (ChangeMessage m : input.messages()) {