[JCBC-68] Query.copy() copies Key into EndkeyDocID Created: 26/Jun/12  Updated: 29/Jun/12  Resolved: 29/Jun/12

Status: Resolved
Project: Couchbase Java Client
Component/s: Core
Affects Version/s: 1.1dp
Fix Version/s: 1.1dp2
Security Level: Public

Type: Bug Priority: Major
Reporter: Jose Assignee: Mike Wiederhold
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 5m
Time Spent: Not Specified
Original Estimate: 5m
Environment: All.
Tested on Ubuntu Server 12.04LTS, Oracle/Sun JDK 1.6.0_31


 Description   
The bug causes all query results are not as expected: in every case "key" argument is changed to "EndkeyDocID".

My proposed patch:

$
diff --git a/src/main/java/com/couchbase/client/protocol/views/Query.java b/src/main/java/com/couchbase/client/protocol/views/Query.java
index fca7ccf..3a019a0 100644
--- a/src/main/java/com/couchbase/client/protocol/views/Query.java
+++ b/src/main/java/com/couchbase/client/protocol/views/Query.java
@@ -174,7 +174,7 @@ public class Query {
       query.setInclusiveEnd(((Boolean)args.get(INCLUSIVEEND)).booleanValue());
     }
     if (args.containsKey(KEY)) {
- query.setEndkeyDocID(((String)args.get(KEY)));
+ query.setKey(((String)args.get(KEY)));
     }
     if (args.containsKey(LIMIT)) {
       query.setLimit(((Integer)args.get(LIMIT)).intValue());
$
Generated at Thu Jul 31 03:23:18 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.