throw new IllegalStateException("Comment line must be >= 1, not "
+ comment.getLine());
}
if (comment.getParentUuid() != null) {
final PatchLineComment parent =
db.patchComments().get(
new PatchLineComment.Key(patchKey, comment.getParentUuid()));
if (parent == null || parent.getSide() != comment.getSide()) {
throw new IllegalStateException("Parent comment must be on same side");
}
}
final PatchLineComment nc =
new PatchLineComment(new PatchLineComment.Key(patchKey, ChangeUtil
.messageUUID(db)), comment.getLine(), me, comment.getParentUuid());
nc.setSide(comment.getSide());
nc.setMessage(comment.getMessage());
db.patchComments().insert(Collections.singleton(nc));
db.commit();
return nc;
} else {