Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fa16261

Browse filesBrowse files
committed
position of pr comment can be null and original_position is not parsed
position of pr comment is null when comment is outdated (ie. not located in diff patch anymore)
1 parent 15991fd commit fa16261
Copy full SHA for fa16261

File tree

Expand file treeCollapse file tree

1 file changed

+8
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-5
lines changed

‎src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import java.io.IOException;
2727
import java.net.URL;
28+
import javax.annotation.CheckForNull;
2829

2930
import static org.kohsuke.github.Previews.*;
3031

@@ -41,8 +42,8 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
4142
private String body;
4243
private GHUser user;
4344
private String path;
44-
private int position;
45-
private int originalPosition;
45+
private int position = -1;
46+
private int original_position = -1;
4647

4748
public static GHPullRequestReviewComment draft(String body, String path, int position) {
4849
GHPullRequestReviewComment result = new GHPullRequestReviewComment();
@@ -82,12 +83,14 @@ public String getPath() {
8283
return path;
8384
}
8485

85-
public int getPosition() {
86-
return position;
86+
@CheckForNull
87+
public Integer getPosition() {
88+
return position == -1 ? null : position;
8789
}
8890

91+
@CheckForNull
8992
public int getOriginalPosition() {
90-
return originalPosition;
93+
return original_position == -1 ? null : original_position;
9194
}
9295

9396
@Override

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.