mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
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)
This commit is contained in:
@@ -25,6 +25,7 @@ package org.kohsuke.github;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import javax.annotation.CheckForNull;
|
||||
|
||||
import static org.kohsuke.github.Previews.*;
|
||||
|
||||
@@ -41,8 +42,8 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
|
||||
private String body;
|
||||
private GHUser user;
|
||||
private String path;
|
||||
private int position;
|
||||
private int originalPosition;
|
||||
private int position = -1;
|
||||
private int original_position = -1;
|
||||
|
||||
public static GHPullRequestReviewComment draft(String body, String path, int position) {
|
||||
GHPullRequestReviewComment result = new GHPullRequestReviewComment();
|
||||
@@ -82,12 +83,14 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
|
||||
return path;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
@CheckForNull
|
||||
public Integer getPosition() {
|
||||
return position == -1 ? null : position;
|
||||
}
|
||||
|
||||
@CheckForNull
|
||||
public int getOriginalPosition() {
|
||||
return originalPosition;
|
||||
return original_position == -1 ? null : original_position;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user