return iterable

This commit is contained in:
Joe
2020-07-30 21:41:16 +01:00
parent a0bbba748a
commit f146ae94ec
2 changed files with 10 additions and 8 deletions

View File

@@ -5,9 +5,9 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.IOException;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.stream.Stream;
import java.util.List;
/**
* Represents a check run.
@@ -112,14 +112,14 @@ public class GHCheckRun extends GHObject {
* @throws IOException
* the io exception
*/
public Iterator<GHPullRequest> getPullRequests() throws IOException {
public List<GHPullRequest> getPullRequests() throws IOException {
if (pullRequests != null && pullRequests.length != 0) {
for (GHPullRequest singlePull : pullRequests) {
singlePull.refresh();
}
return Arrays.stream(pullRequests).iterator();
return Arrays.asList(pullRequests);
}
return Stream.<GHPullRequest>empty().iterator();
return Collections.emptyList();
}
/**