Skip to content

Commit 3650cd3

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 6215 b: refs/heads/tswast-patch-1 c: b8923f4 h: refs/heads/master i: 6213: ce0a56f 6211: 7cedd10 6207: f35ce4e
1 parent 4f48b88 commit 3650cd3

2 files changed

Lines changed: 5 additions & 7 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: e1a50bc0063c25a4bfa729c8b305f06e061f0497
60+
refs/heads/tswast-patch-1: b8923f4765277e8420d31ca2b88d312f8d58061d
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/gcloud-java-datastore/src/main/java/com/google/gcloud/spi/DefaultDatastoreRpc.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.google.api.services.datastore.client.DatastoreException;
3333
import com.google.api.services.datastore.client.DatastoreFactory;
3434
import com.google.api.services.datastore.client.DatastoreOptions.Builder;
35+
import com.google.common.base.Preconditions;
3536
import com.google.common.collect.ImmutableMap;
3637
import com.google.gcloud.datastore.DatastoreOptions;
3738
import com.google.gcloud.spi.DatastoreRpc.DatastoreRpcException.Reason;
@@ -78,12 +79,9 @@ public DefaultDatastoreRpc(DatastoreOptions options) {
7879
private static String normalizeHost(String host) {
7980
host = host.toLowerCase();
8081
if (includesScheme(host)) {
81-
if (host.startsWith("https://") && isLocalHost(host)) {
82-
throw new IllegalArgumentException(
83-
"\"https\" is not supported for localhost. Use \"http\" instead.");
84-
} else {
85-
return host;
86-
}
82+
Preconditions.checkArgument(!(host.startsWith("https://") && isLocalHost(host)),
83+
"\"https\" is not supported for localhost. Use \"http\" instead.");
84+
return host;
8785
}
8886
return "http://" + host;
8987
}

0 commit comments

Comments
 (0)