Details
-
Bug
-
Resolution: Done
-
Critical
-
5.2.0.Alpha4
-
None
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
- ...