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 f41da19

Browse filesBrowse files
committed
Further restoration of the compatibility
1 parent d0a56db commit f41da19
Copy full SHA for f41da19

File tree

Expand file treeCollapse file tree

2 files changed

+35
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+35
-7
lines changed

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPullRequest.java
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
*/
2424
package org.kohsuke.github;
2525

26+
import javax.annotation.CheckForNull;
2627
import java.io.IOException;
2728
import java.net.URL;
29+
import java.util.Arrays;
2830
import java.util.Collection;
2931
import java.util.Date;
32+
import java.util.List;
3033

3134
/**
3235
* A pull request.
@@ -307,6 +310,28 @@ protected void wrapUp(GHPullRequestCommitDetail[] page) {
307310
};
308311
}
309312

313+
/**
314+
* @deprecated
315+
* Use {@link #createReview()}
316+
*/
317+
public GHPullRequestReview createReview(String body, @CheckForNull GHPullRequestReviewState event,
318+
GHPullRequestReviewComment... comments) throws IOException {
319+
return createReview(body, event, Arrays.asList(comments));
320+
}
321+
322+
/**
323+
* @deprecated
324+
* Use {@link #createReview()}
325+
*/
326+
public GHPullRequestReview createReview(String body, @CheckForNull GHPullRequestReviewState event,
327+
List<GHPullRequestReviewComment> comments) throws IOException {
328+
GHPullRequestReviewBuilder b = createReview().body(body);
329+
for (GHPullRequestReviewComment c : comments) {
330+
b.comment(c.getBody(), c.getPath(), c.getPosition());
331+
}
332+
return b.create();
333+
}
334+
310335
public GHPullRequestReviewBuilder createReview() {
311336
return new GHPullRequestReviewBuilder(this);
312337
}

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java
+10-7Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
4747
private long in_reply_to_id = -1L;
4848

4949

50+
/**
51+
* @deprecated
52+
* You should be using {@link GHPullRequestReviewBuilder#comment(String, String, int)}
53+
*/
5054
public static GHPullRequestReviewComment draft(String body, String path, int position) {
5155
GHPullRequestReviewComment result = new GHPullRequestReviewComment();
5256
result.body = body;
@@ -86,18 +90,17 @@ public String getPath() {
8690
}
8791

8892
@CheckForNull
89-
public Integer getPosition() {
90-
return position == -1 ? null : position;
93+
public int getPosition() {
94+
return position;
9195
}
9296

93-
@CheckForNull
94-
public Integer getOriginalPosition() {
95-
return original_position == -1 ? null : original_position;
97+
public int getOriginalPosition() {
98+
return original_position;
9699
}
97100

98101
@CheckForNull
99-
public Long getInReplyToId() {
100-
return in_reply_to_id == -1 ? null : in_reply_to_id;
102+
public long getInReplyToId() {
103+
return in_reply_to_id;
101104
}
102105

103106
@Override

0 commit comments

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