Skip to content

Commit 93f602c

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 3591 b: refs/heads/pubsub-alpha c: 8050cca h: refs/heads/master i: 3589: 7b1d2d7 3587: 4735f1f 3583: 01b073b
1 parent 4c344c9 commit 93f602c

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 36a62ef856d199f8efd09501b5ba65c422c01f23
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 7406918e071dd2c5677a638ae2a06e7592b6542c
5-
refs/heads/pubsub-alpha: a68a0b60c09f990073b0d5103b11dcd9596e73ea
5+
refs/heads/pubsub-alpha: 8050cca81afee5f6a952cc7c544e3ae5aa616633
66
refs/heads/update-datastore: 47aae517c2cb33f1dccd909adaced73ec9d0f4df
77
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
88
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd

branches/pubsub-alpha/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/BaseEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ public <K extends IncompleteKey> FullEntity<K> getEntity(String name) {
437437
* @throws ClassCastException if value is not a list of values
438438
*/
439439
@SuppressWarnings("unchecked")
440-
public List<? extends Value<?>> getList(String name) {
441-
return ((Value<List<? extends Value<?>>>) getValue(name)).get();
440+
public <T extends Value<?>> List<T> getList(String name) {
441+
return (List<T>) getValue(name).get();
442442
}
443443

444444
/**

branches/pubsub-alpha/gcloud-java-datastore/src/test/java/com/google/gcloud/datastore/BaseEntityTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void setUp() {
7474
builder.set("doubleList", 12.3, 4.56, .789);
7575
builder.set("keyList", KEY, Key.builder("ds2", "k2", "n2").build(),
7676
Key.builder("ds3", "k3", "n3").build());
77-
builder.set("entityList", ENTITY, PARTIAL_ENTITY, ENTITY);
77+
builder.set("entityList", ENTITY, PARTIAL_ENTITY);
7878
builder.set("stringList", "s1", "s2", "s3");
7979
builder.set("longList", 1, 23, 456);
8080
}
@@ -193,6 +193,17 @@ public void testGetList() throws Exception {
193193
assertEquals(Boolean.TRUE, list.get(0).get());
194194
entity = builder.set("list1", ListValue.of(list)).build();
195195
assertEquals(list, entity.getList("list1"));
196+
List<Value<?>> stringList = entity.getList("stringList");
197+
assertEquals(
198+
ImmutableList.of(StringValue.of("s1"), StringValue.of("s2"), StringValue.of("s3")),
199+
stringList);
200+
List<Value<Double>> doubleList = entity.getList("doubleList");
201+
assertEquals(
202+
ImmutableList.of(DoubleValue.of(12.3), DoubleValue.of(4.56), DoubleValue.of(.789)),
203+
doubleList);
204+
List<EntityValue> entityList = entity.getList("entityList");
205+
assertEquals(
206+
ImmutableList.of(EntityValue.of(ENTITY), EntityValue.of(PARTIAL_ENTITY)), entityList);
196207
}
197208

198209
@Test

0 commit comments

Comments
 (0)