Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
0000944: Recursive call while processing data for routing when there …
…are a lot of gaps can cause stack over flow error
  • Loading branch information
chenson42 committed Dec 10, 2012
1 parent 5c94ded commit 3c196d8
Showing 1 changed file with 4 additions and 6 deletions.
Expand Up @@ -160,22 +160,20 @@ protected void execute() {

protected boolean process(Data data) {
long dataId = data.getDataId();
if (currentGap != null && dataId >= currentGap.getStartId()) {
boolean okToProcess = false;
while (!okToProcess && currentGap != null && dataId >= currentGap.getStartId()) {
if (dataId <= currentGap.getEndId()) {
return true;
okToProcess = true;
} else {
// past current gap. move to next gap
if (dataGaps.size() > 0) {
currentGap = dataGaps.remove(0);
return process(data);
} else {
currentGap = null;
return false;
}
}
} else {
return false;
}
return okToProcess;
}

public Data take() throws InterruptedException {
Expand Down

0 comments on commit 3c196d8

Please sign in to comment.