File tree Expand file tree Collapse file tree
gcloud-java-datastore/src/main/java/com/google/gcloud/spi Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232import com .google .api .services .datastore .client .DatastoreException ;
3333import com .google .api .services .datastore .client .DatastoreFactory ;
3434import com .google .api .services .datastore .client .DatastoreOptions .Builder ;
35+ import com .google .common .base .Preconditions ;
3536import com .google .common .collect .ImmutableMap ;
3637import com .google .gcloud .datastore .DatastoreOptions ;
3738import 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 }
You can’t perform that action at this time.
0 commit comments