Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-40

paginatedQuery throws NoSuchElementException and NPE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 1.1-beta
    • 1.1dp
    • Core
    • Security Level: Public
    • None
    • java

    Description

      view iteration is incomplete and throws exceptions for
      groovy code:
      paginator = client.paginatedQuery(view, query, n)
      while (paginator.hasNext())

      { row = paginator.next() // Exception on this line ... }

      java.util.NoSuchElementException
      at java.util.LinkedList$ListItr.next(LinkedList.java:698)
      at com.couchbase.client.protocol.views.Paginator.next(Paginator.java:76)
      at com.couchbase.client.protocol.views.Paginator.next(Paginator.java:35)
      at java_util_Iterator$next.call(Unknown Source)

      AND

      java.lang.NullPointerException
      at com.couchbase.client.protocol.views.Paginator.getNextPage(Paginator.java:93)
      at com.couchbase.client.protocol.views.Paginator.hasNext(Paginator.java:67)
      at java_util_Iterator$hasNext.call(Unknown Source)

      Paginator also has a couple odd returns
      1) next() can return null, but it should never return null unless lastRow is null. I don't think lastRow should ever be null.
      2) getNextPage() has a return type, HttpFuture<ViewResponse>, but always returns null

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            daschl Michael Nitschinger
            SteveC Steven Cooke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty