Skip to content

Commit

Permalink
PDFBOX-5112: SonarCube fix, throw NoSuchElementException if no more e…
Browse files Browse the repository at this point in the history
…lements are available

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1887295 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
lehmi committed Mar 7, 2021
1 parent ef53b45 commit 8c47be1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.NoSuchElementException;

import org.apache.pdfbox.cos.COSArray;
import org.apache.pdfbox.cos.COSBase;
Expand Down Expand Up @@ -212,6 +213,10 @@ public boolean hasNext()
@Override
public Long next()
{
if (currentNumber >= maxValue)
{
throw new NoSuchElementException();
}
if (currentNumber < currentEnd)
{
return currentNumber++;
Expand Down

0 comments on commit 8c47be1

Please sign in to comment.