Skip to content

Commit 7b59256

Browse files
author
Ajay Kannan
committed
Variable renames
1 parent 85c3e05 commit 7b59256

File tree

1 file changed

+15
-15
lines changed
  • datastore/src/main/java/com/google/datastore/snippets

1 file changed

+15
-15
lines changed

datastore/src/main/java/com/google/datastore/snippets/Concepts.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -911,12 +911,12 @@ public void testPropertyRunQuery() {
911911
setUpQueryTests();
912912
// [START property_run_query]
913913
Query<Key> query = Query.keyQueryBuilder().kind("__property__").build();
914-
QueryResults<Key> results = datastore.run(query);
914+
QueryResults<Key> keys = datastore.run(query);
915915
Map<String, Collection<String>> propertiesByKind = new HashMap<>();
916-
while (results.hasNext()) {
917-
Key property = results.next();
918-
String kind = property.parent().name();
919-
String propertyName = property.name();
916+
while (keys.hasNext()) {
917+
Key key = keys.next();
918+
String kind = key.parent().name();
919+
String propertyName = key.name();
920920
Collection<String> properties = propertiesByKind.get(kind);
921921
if (properties == null) {
922922
properties = new HashSet<>();
@@ -942,9 +942,9 @@ public void testPropertyByKindRunQuery() {
942942
QueryResults<Entity> results = datastore.run(query);
943943
Map<String, Collection<String>> representationsByProperty = new HashMap<>();
944944
while (results.hasNext()) {
945-
Entity property = results.next();
946-
String propertyName = property.key().name();
947-
List<StringValue> representations = property.getList("property_representation");
945+
Entity result = results.next();
946+
String propertyName = result.key().name();
947+
List<StringValue> representations = result.getList("property_representation");
948948
Collection<String> currentRepresentations = representationsByProperty.get(propertyName);
949949
if (currentRepresentations == null) {
950950
currentRepresentations = new HashSet<>();
@@ -971,20 +971,20 @@ public void testPropertyByKindRunQuery() {
971971
public void testPropertyFilteringRunQuery() {
972972
setUpQueryTests();
973973
// [START property_filtering_run_query]
974-
Key key = datastore.newKeyFactory()
974+
Key startKey = datastore.newKeyFactory()
975975
.kind("__property__")
976976
.ancestors(PathElement.of("__kind__", "Task"))
977977
.newKey("priority");
978978
Query<Key> query = Query.keyQueryBuilder()
979979
.kind("__property__")
980-
.filter(PropertyFilter.ge("__key__", key))
980+
.filter(PropertyFilter.ge("__key__", startKey))
981981
.build();
982982
Map<String, Collection<String>> propertiesByKind = new HashMap<>();
983-
QueryResults<Key> results = datastore.run(query);
984-
while (results.hasNext()) {
985-
Key property = results.next();
986-
String kind = property.parent().name();
987-
String propertyName = property.name();
983+
QueryResults<Key> keys = datastore.run(query);
984+
while (keys.hasNext()) {
985+
Key key = keys.next();
986+
String kind = key.parent().name();
987+
String propertyName = key.name();
988988
Collection<String> properties = propertiesByKind.get(kind);
989989
if (properties == null) {
990990
properties = new HashSet<String>();

0 commit comments

Comments
 (0)