Skip to content

Commit e75d5b6

Browse files
committed
---
yaml --- r: 117 b: refs/heads/master c: ac75af9 h: refs/heads/master i: 115: 1406e89 v: v3
1 parent bab664f commit e75d5b6

11 files changed

Lines changed: 8 additions & 598 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 09779e91e6b9fdc16d2c7aab289a0da3c47bf9e6
2+
refs/heads/master: ac75af9d9e7bb1e3523252d3678ae9d18df70198

trunk/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Java idiomatic client for Google Cloud Platform services. Supported APIs include
1212
> Note: This package is a work-in-progress, and may occasionally
1313
> make backwards-incompatible changes.
1414
15-
Documentation and examples are available [here](https://googlecloudeplatform.github.com/gcloud-java/apidocs).
15+
16+
Documentation and examples are available [here](http://googlecloudplatform.github.io/gcloud-java/apidocs).
1617

1718
## Google Cloud Datastore
1819

trunk/src/main/java/com/google/gcloud/datastore/BaseKey.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public B namespace(String namespace) {
107107
}
108108

109109
BaseKey(String dataset, String namespace, ImmutableList<PathElement> path) {
110-
Preconditions.checkArgument(!path.isEmpty(), "Path must not be empty");
111110
this.dataset = dataset;
112111
this.namespace = namespace;
113112
this.path = path;

trunk/src/main/java/com/google/gcloud/datastore/Key.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import com.google.api.services.datastore.DatastoreV1;
2222
import com.google.common.base.Preconditions;
2323
import com.google.common.collect.ImmutableList;
24+
import com.google.protobuf.ByteString;
2425
import com.google.protobuf.InvalidProtocolBufferException;
25-
import com.google.protobuf.TextFormat;
2626

2727
import java.io.UnsupportedEncodingException;
2828
import java.net.URLDecoder;
@@ -138,7 +138,7 @@ public Object nameOrId() {
138138
*/
139139
public String toUrlSafe() {
140140
try {
141-
return URLEncoder.encode(TextFormat.printToString(toPb()), UTF_8.name());
141+
return URLEncoder.encode(toString(), UTF_8.name());
142142
} catch (UnsupportedEncodingException e) {
143143
throw new IllegalStateException("Unexpected encoding exception", e);
144144
}
@@ -152,12 +152,11 @@ public String toUrlSafe() {
152152
public static Key fromUrlSafe(String urlSafe) {
153153
try {
154154
String utf8Str = URLDecoder.decode(urlSafe, UTF_8.name());
155-
DatastoreV1.Key.Builder builder = DatastoreV1.Key.newBuilder();
156-
TextFormat.merge(utf8Str, builder);
157-
return fromPb(builder.build());
155+
DatastoreV1.Key keyPb = DatastoreV1.Key.parseFrom(ByteString.copyFromUtf8(utf8Str));
156+
return fromPb(keyPb);
158157
} catch (UnsupportedEncodingException e) {
159158
throw new IllegalStateException("Unexpected decoding exception", e);
160-
} catch (TextFormat.ParseException e) {
159+
} catch (InvalidProtocolBufferException e) {
161160
throw new IllegalArgumentException("Could not parse key", e);
162161
}
163162
}

trunk/src/test/java/com/google/gcloud/datastore/BaseKeyTest.java

Lines changed: 0 additions & 125 deletions
This file was deleted.

trunk/src/test/java/com/google/gcloud/datastore/EntityTest.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

trunk/src/test/java/com/google/gcloud/datastore/KeyTest.java

Lines changed: 0 additions & 79 deletions
This file was deleted.

trunk/src/test/java/com/google/gcloud/datastore/PartialEntityTest.java

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)