From 243ad4b43e977b51643933c42c97c00123d97e3d Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 25 Feb 2015 15:09:08 +0100 Subject: Fix quality flaw --- .../src/main/java/org/sonar/server/issue/index/IssueIndex.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 scroll(final String scrollId) { return new Iterator() { - private final Queue 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()); } -- cgit v1.2.3