Skip to content

Commit eb39191

Browse files
committed
---
yaml --- r: 5877 b: refs/heads/tswast-patch-1 c: ac75af9 h: refs/heads/master i: 5875: 4124570
1 parent b5ecb4a commit eb39191

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
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 09779e91e6b9fdc16d2c7aab289a0da3c47bf9e6
60+
refs/heads/tswast-patch-1: ac75af9d9e7bb1e3523252d3678ae9d18df70198
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/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

branches/tswast-patch-1/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;

branches/tswast-patch-1/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
}

branches/tswast-patch-1/src/test/java/com/google/gcloud/datastore/BaseKeyTest.java

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

branches/tswast-patch-1/src/test/java/com/google/gcloud/datastore/EntityTest.java

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

branches/tswast-patch-1/src/test/java/com/google/gcloud/datastore/KeyTest.java

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

branches/tswast-patch-1/src/test/java/com/google/gcloud/datastore/PartialEntityTest.java

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

0 commit comments

Comments
 (0)