diff --git a/src/main/java/org/kohsuke/github/GHCheckRun.java b/src/main/java/org/kohsuke/github/GHCheckRun.java index a2c74a304..b63537086 100644 --- a/src/main/java/org/kohsuke/github/GHCheckRun.java +++ b/src/main/java/org/kohsuke/github/GHCheckRun.java @@ -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 getPullRequests() throws IOException { + public List 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.empty().iterator(); + return Collections.emptyList(); } /** diff --git a/src/main/java/org/kohsuke/github/GHCheckSuite.java b/src/main/java/org/kohsuke/github/GHCheckSuite.java index 0fca06302..54bcd485e 100644 --- a/src/main/java/org/kohsuke/github/GHCheckSuite.java +++ b/src/main/java/org/kohsuke/github/GHCheckSuite.java @@ -5,8 +5,10 @@ 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.List; import java.util.stream.Stream; /** @@ -160,14 +162,14 @@ public class GHCheckSuite extends GHObject { * @throws IOException * the io exception */ - public Iterator getPullRequests() throws IOException { + public List 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.empty().iterator(); + return Collections.emptyList(); } /**