Skip to content

Commit f146ae9

Browse files
author
Joe
committed
return iterable
1 parent a0bbba7 commit f146ae9

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/main/java/org/kohsuke/github/GHCheckRun.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import java.io.IOException;
66
import java.net.URL;
77
import java.util.Arrays;
8+
import java.util.Collections;
89
import java.util.Date;
9-
import java.util.Iterator;
10-
import java.util.stream.Stream;
10+
import java.util.List;
1111

1212
/**
1313
* Represents a check run.
@@ -112,14 +112,14 @@ public String getHeadSha() {
112112
* @throws IOException
113113
* the io exception
114114
*/
115-
public Iterator<GHPullRequest> getPullRequests() throws IOException {
115+
public List<GHPullRequest> getPullRequests() throws IOException {
116116
if (pullRequests != null && pullRequests.length != 0) {
117117
for (GHPullRequest singlePull : pullRequests) {
118118
singlePull.refresh();
119119
}
120-
return Arrays.stream(pullRequests).iterator();
120+
return Arrays.asList(pullRequests);
121121
}
122-
return Stream.<GHPullRequest>empty().iterator();
122+
return Collections.emptyList();
123123
}
124124

125125
/**

src/main/java/org/kohsuke/github/GHCheckSuite.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
import java.io.IOException;
66
import java.net.URL;
77
import java.util.Arrays;
8+
import java.util.Collections;
89
import java.util.Date;
910
import java.util.Iterator;
11+
import java.util.List;
1012
import java.util.stream.Stream;
1113

1214
/**
@@ -160,14 +162,14 @@ public GHApp getApp() {
160162
* @throws IOException
161163
* the io exception
162164
*/
163-
public Iterator<GHPullRequest> getPullRequests() throws IOException {
165+
public List<GHPullRequest> getPullRequests() throws IOException {
164166
if (pullRequests != null && pullRequests.length != 0) {
165167
for (GHPullRequest singlePull : pullRequests) {
166168
singlePull.refresh();
167169
}
168-
return Arrays.stream(pullRequests).iterator();
170+
return Arrays.asList(pullRequests);
169171
}
170-
return Stream.<GHPullRequest>empty().iterator();
172+
return Collections.emptyList();
171173
}
172174

173175
/**

0 commit comments

Comments
 (0)