[infinispan-issues] [JBoss JIRA] (ISPN-2337) Query iterators are buggy
Marko Lukša (JIRA)
jira-events at lists.jboss.org
Mon Sep 24 06:35:35 EDT 2012
[ https://issues.jboss.org/browse/ISPN-2337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marko Lukša updated ISPN-2337:
------------------------------
Description:
I have found multiple problems with the iterators returned by CacheQueryImpl.
- using LazyIterator with fetchSize fails with ArrayIndexOutOfBoundsException
- calling previous() after next() doesn't return expected element
- calling nextIndex() on a new iterator should return 0, not 1 (the same also applies when calling nextIndex() after calling first())
- if fetchSize is greater than 1, LazyIterator fills the whole buffer on every invocation of .previous() (if fetchSize = 10, then _every_ invocation of previous() loads 10 results from the cache)
- nextIndex() and previousIndex() throw NoSuchElementException, which violates the contract of ListInterface
- next() and previous() throw ArrayIndexOutOfBoundsException when they should be throwing NoSuchElementException
- ...
was:
I have found multiple problems with the iterators returned by CacheQueryImpl.
- using LazyIterator with fetchSize fails with ArrayIndexOutOfBoundsException
- calling previous() after next() doesn't return expected element
- calling nextIndex() on a new iterator should return 0, not 1 (the same also applies when calling nextIndex() after calling first())
- if fetchSize is greater than 1, LazyIterator fills the whole buffer on every invocation of .previous()
- nextIndex() and previousIndex() throw NoSuchElementException, which violates the contract of ListInterface
- next() and previous() throw ArrayIndexOutOfBoundsException when they should be throwing NoSuchElementException
- ...
> Query iterators are buggy
> -------------------------
>
> Key: ISPN-2337
> URL: https://issues.jboss.org/browse/ISPN-2337
> Project: Infinispan
> Issue Type: Bug
> Components: Querying
> Affects Versions: 5.2.0.Alpha4
> Reporter: Marko Lukša
> Assignee: Marko Lukša
>
> I have found multiple problems with the iterators returned by CacheQueryImpl.
> - using LazyIterator with fetchSize fails with ArrayIndexOutOfBoundsException
> - calling previous() after next() doesn't return expected element
> - calling nextIndex() on a new iterator should return 0, not 1 (the same also applies when calling nextIndex() after calling first())
> - if fetchSize is greater than 1, LazyIterator fills the whole buffer on every invocation of .previous() (if fetchSize = 10, then _every_ invocation of previous() loads 10 results from the cache)
> - nextIndex() and previousIndex() throw NoSuchElementException, which violates the contract of ListInterface
> - next() and previous() throw ArrayIndexOutOfBoundsException when they should be throwing NoSuchElementException
> - ...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list