File tree Expand file tree Collapse file tree 2 files changed +35
-7
lines changed
Filter options
src/main/java/org/kohsuke/github Expand file tree Collapse file tree 2 files changed +35
-7
lines changed
Original file line number Diff line number Diff line change 23
23
*/
24
24
package org .kohsuke .github ;
25
25
26
+ import javax .annotation .CheckForNull ;
26
27
import java .io .IOException ;
27
28
import java .net .URL ;
29
+ import java .util .Arrays ;
28
30
import java .util .Collection ;
29
31
import java .util .Date ;
32
+ import java .util .List ;
30
33
31
34
/**
32
35
* A pull request.
@@ -307,6 +310,28 @@ protected void wrapUp(GHPullRequestCommitDetail[] page) {
307
310
};
308
311
}
309
312
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
+
310
335
public GHPullRequestReviewBuilder createReview () {
311
336
return new GHPullRequestReviewBuilder (this );
312
337
}
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
47
47
private long in_reply_to_id = -1L ;
48
48
49
49
50
+ /**
51
+ * @deprecated
52
+ * You should be using {@link GHPullRequestReviewBuilder#comment(String, String, int)}
53
+ */
50
54
public static GHPullRequestReviewComment draft (String body , String path , int position ) {
51
55
GHPullRequestReviewComment result = new GHPullRequestReviewComment ();
52
56
result .body = body ;
@@ -86,18 +90,17 @@ public String getPath() {
86
90
}
87
91
88
92
@ CheckForNull
89
- public Integer getPosition () {
90
- return position == - 1 ? null : position ;
93
+ public int getPosition () {
94
+ return position ;
91
95
}
92
96
93
- @ CheckForNull
94
- public Integer getOriginalPosition () {
95
- return original_position == -1 ? null : original_position ;
97
+ public int getOriginalPosition () {
98
+ return original_position ;
96
99
}
97
100
98
101
@ 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 ;
101
104
}
102
105
103
106
@ Override
You can’t perform that action at this time.
0 commit comments