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

Review API for Query result iterators

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 5.2.0.Final
    • 5.2.0.Final
    • Embedded Querying
    • None

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

              marko.luksa@gmail.com Marko Luksa (Inactive)
              marko.luksa@gmail.com Marko Luksa (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: