diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt index b9bb3eb951..662bbfed85 100644 --- a/Documentation/rest-api-changes.txt +++ b/Documentation/rest-api-changes.txt @@ -1877,6 +1877,15 @@ link:#review-input[ReviewInput] entity. { "line": 49, "message": "[nit] s/conrtol/control" + }, + { + "range": { + "start_line": 50, + "start_character": 0, + "end_line": 55, + "end_character": 20 + }, + "message": "Incorrect indentation" } ] } @@ -3273,7 +3282,7 @@ If not set, the default is `REVISION`. The number of the line for which the comment should be added. + `0` if it is a file comment. + If neither line nor range is set, a file comment is added. + -If range is set, this should equal the end line of the range. +If range is set, this value is ignored in favor of the `end_line` of the range. |`range` |optional| The range of the comment as a link:#comment-range[CommentRange] entity. 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 bf8474ff7c..4b6e72ce86 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 @@ -371,6 +371,7 @@ public class PostReview implements RestModifyView c.range.startCharacter, c.range.endLine, c.range.endCharacter)); + e.setLine(c.range.endLine); } ups.add(e); }