Skip to content

Commit 8c33a70

Browse files
committed
Avoid pagination when not required
1 parent 8318caf commit 8c33a70

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import edu.umd.cs.findbugs.annotations.CheckForNull;
2929
import edu.umd.cs.findbugs.annotations.NonNull;
3030
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
31+
import io.jsonwebtoken.lang.Arrays;
32+
3133
import org.apache.commons.lang3.StringUtils;
3234
import org.kohsuke.github.function.InputStreamFunction;
3335
import org.kohsuke.github.internal.EnumUtils;
@@ -3627,11 +3629,10 @@ public void unstar() throws IOException {
36273629
* the io exception
36283630
*/
36293631
public List<GHRepositoryTrafficTopReferralPath> getTopReferralPaths() throws IOException {
3630-
return root().createRequest()
3632+
return Arrays.asList(root().createRequest()
36313633
.method("GET")
36323634
.withUrlPath("/repos/%s/%s/traffic/popular/paths", getOwnerName(), name)
3633-
.toIterable(GHRepositoryTrafficTopReferralPath[].class, null)
3634-
.toList();
3635+
.fetch(GHRepositoryTrafficTopReferralPath[].class));
36353636
}
36363637

36373638
/**
@@ -3643,11 +3644,10 @@ public List<GHRepositoryTrafficTopReferralPath> getTopReferralPaths() throws IOE
36433644
* the io exception
36443645
*/
36453646
public List<GHRepositoryTrafficTopReferralSources> getTopReferralSources() throws IOException {
3646-
return root().createRequest()
3647+
return Arrays.asList(root().createRequest()
36473648
.method("GET")
36483649
.withUrlPath("/repos/%s/%s/traffic/popular/referrers", getOwnerName(), name)
3649-
.toIterable(GHRepositoryTrafficTopReferralSources[].class, null)
3650-
.toList();
3650+
.fetch(GHRepositoryTrafficTopReferralSources[].class));
36513651
}
36523652

36533653
/**

0 commit comments

Comments
 (0)