Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2337

Review API for Query result iterators

    XMLWordPrintable

Details

    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
      • ...

      Attachments

        Activity

          People

            marko.luksa@gmail.com Marko Luksa (Inactive)
            marko.luksa@gmail.com Marko Luksa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: