
|
If you were logged in you would be able to see more operations.
|
|
Sesame
Created: 26/Nov/08 04:06 PM
Updated: 17/Dec/08 02:04 PM
|
|
| Component/s: |
None
|
| Affects Version/s: |
2.2.1
|
| Fix Version/s: |
2.2.2
|
|
The OrderIterator pulls all the results from its wrapped iteration into a list, then sorts it. However, whilst in this extract loop it doesn't check for close, so a timeout call is not respected. Adding checks into the loop, and for the sort immediately after would be useful, e.g.:
private Iterator<BindingSet> getOrderedIterator()
throws QueryEvaluationException {
if (ordered == null) {
List<BindingSet> list = new ArrayList<BindingSet>(1024);
while (!isClosed() && iter.hasNext()) {
list.add(iter.next());
}
if(!isClosed()) {
Collections.sort(list, comparator);
}
ordered = list.iterator();
}
return ordered;
}
|
|
Actually, closing the underlying iteration may be more consistent with the approach elsewhere. It would still be useful to avoid performing the sort if the iteration has been closed though, since it can be a costly operation.
The result ordering code has been cleaned up and an isClosed() check has been added before starting the actual sorting.
|
|