Skip to content

Commit 0fe9c49

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 1565 b: refs/heads/master c: 2219c82 h: refs/heads/master i: 1563: 84f87ae
1 parent 9f92ffe commit 0fe9c49

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a2e60abf83d6603ecf9f0e80b0c95082e8ce0fbb
2+
refs/heads/master: 2219c82af21997fe66b952b062ff7fe7006503b9
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: d1b373c30c176edc08692348167bec3a244bb823
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/QueryResults.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ public interface QueryResults<V> extends Iterator<V> {
3535
Class<?> resultClass();
3636

3737
/**
38-
* Returns the Cursor for the point after the value returned in the last {@link #next} call. Until
39-
* v1beta3 is supported, this field should only be used if you have set a limit and the number of
40-
* results is equal to that limit.
38+
* Returns the Cursor for the point after the value returned in the last {@link #next} call.
39+
* Currently, {@code cursorAfter} returns null in all cases but the last result.
4140
*/
4241
Cursor cursorAfter();
4342
}

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/QueryResultsImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ public Class<?> resultClass() {
100100
@Override
101101
public Cursor cursorAfter() {
102102
//return new Cursor(cursor); // only available in v1beta3
103-
return new Cursor(queryResultBatchPb.getEndCursor());
103+
if (!hasNext()) {
104+
return new Cursor(queryResultBatchPb.getEndCursor());
105+
}
106+
return null;
104107
}
105108
}

trunk/gcloud-java-datastore/src/test/java/com/google/gcloud/datastore/DatastoreTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public void testQueryPaginationWithLimit() throws DatastoreRpcException {
478478
}
479479
EasyMock.replay(rpcFactoryMock, rpcMock);
480480
Datastore mockDatastore =
481-
this.options.toBuilder()
481+
options.toBuilder()
482482
.retryParams(RetryParams.defaultInstance())
483483
.serviceRpcFactory(rpcFactoryMock)
484484
.build()

0 commit comments

Comments
 (0)