Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
69c15a39
Unverified
Commit
69c15a39
authored
Jun 07, 2021
by
Gautier de Saint Martin Lacaze
Committed by
GitHub
Jun 07, 2021
Browse files
Merge pull request #713 from gitlab4j/issue-658
Fix #658 : Pager not working properly
parents
db8f9254
4e9f7a6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/Pager.java
View file @
69c15a39
...
...
@@ -306,12 +306,6 @@ public class Pager<T> implements Iterator<List<T>>, Constants {
*/
public
List
<
T
>
page
(
int
pageNumber
)
{
if
(
pageNumber
>
totalPages
&&
pageNumber
>
kaminariNextPage
)
{
throw
new
NoSuchElementException
();
}
else
if
(
pageNumber
<
1
)
{
throw
new
NoSuchElementException
();
}
if
(
currentPage
==
0
&&
pageNumber
==
1
)
{
currentPage
=
1
;
return
(
currentItems
);
...
...
@@ -321,6 +315,12 @@ public class Pager<T> implements Iterator<List<T>>, Constants {
return
(
currentItems
);
}
if
(
pageNumber
>
totalPages
&&
pageNumber
>
kaminariNextPage
)
{
throw
new
NoSuchElementException
();
}
else
if
(
pageNumber
<
1
)
{
throw
new
NoSuchElementException
();
}
try
{
setPageParam
(
pageNumber
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment