diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-25 15:09:08 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-25 15:09:08 +0100 |
commit | 243ad4b43e977b51643933c42c97c00123d97e3d (patch) | |
tree | ba128e6461c42a3e77d9ea2851b8bc8db95c1920 | |
parent | 908b9d0b5b9c21fabd10d697a5466bcc12d80d83 (diff) | |
download | sonarqube-243ad4b43e977b51643933c42c97c00123d97e3d.tar.gz sonarqube-243ad4b43e977b51643933c42c97c00123d97e3d.zip |
Fix quality flaw
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java index a910c7d5b73..927cd512148 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java @@ -725,7 +725,6 @@ public class IssueIndex extends BaseIndex { // Scrolling within the index private Iterator<IssueDoc> scroll(final String scrollId) { return new Iterator<IssueDoc>() { - private final Queue<SearchHit> hits = new ArrayDeque<>(); @Override @@ -740,6 +739,9 @@ public class IssueIndex extends BaseIndex { @Override public IssueDoc next() { + if(!hasNext()){ + throw new NoSuchElementException(); + } return new IssueDoc(hits.poll().getSource()); } |