diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java index a24ae3ec01..d165a4a0f9 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java @@ -455,38 +455,11 @@ public class PostReview implements RestModifyView { for (String d : labelDelta) { buf.append(" ").append(d); } - - if (comments.size() >= 1) { - int inlineCommentCount = 0; - int fileCommentsCount = 0; - for (PatchLineComment c : comments) { - if (c.getLine() == 0) { - fileCommentsCount++; - } else { - inlineCommentCount++; - } - } - buf.append("\n\n("); - if (fileCommentsCount != 0) { - if (fileCommentsCount == 1) { - buf.append("1 file comment"); - } else { - buf.append(String.format("%d file comments", fileCommentsCount)); - } - } - if (inlineCommentCount != 0) { - if (fileCommentsCount != 0) { - buf.append(", "); - } - if (inlineCommentCount == 1) { - buf.append("1 inline comment"); - } else { - buf.append(String.format("%d inline comments", inlineCommentCount)); - } - } - buf.append(")"); + if (comments.size() == 1) { + buf.append("\n\n(1 comment)"); + } else if (comments.size() > 1) { + buf.append(String.format("\n\n(%d comments)", comments.size())); } - if (!msg.isEmpty()) { buf.append("\n\n").append(msg); }