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

Query.copy does not copy includeDocs property

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1dp
    • Fix Version/s: None
    • Component/s: Core
    • Security Level: Public
    • Labels:
      None
    • Environment:
      all java

      Description

      Query.java line 200 in function copy():
      setIncludeDocs(willIncludeDocs());

      Should be
      query.setIncludeDocs(willIncludeDocs());

      Paginated queries depend on copy() so paginatedQuery requiring the document fail with:
      java.lang.UnsupportedOperationException: This view result doesn't contain documents

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

        Activity

        Hide
        SteveC Steven Cooke added a comment -

        Perhaps a better solution:

        /**

        • All values in args map must be immutable
          */
          private Query(Query src) { args = new HashMap<String, Object>(src.args); includedocs = src.willIncludeDocs(); }

        public Query copy()

        { return new Query(this); }
        Show
        SteveC Steven Cooke added a comment - Perhaps a better solution: /** All values in args map must be immutable */ private Query(Query src) { args = new HashMap<String, Object>(src.args); includedocs = src.willIncludeDocs(); } public Query copy() { return new Query(this); }

          People

          • Assignee:
            mikew Mike Wiederhold
            Reporter:
            SteveC Steven Cooke
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes