Skip to content

Commit fe360ed

Browse files
committed
---
yaml --- r: 1343 b: refs/heads/update-datastore c: 9e4692d h: refs/heads/master i: 1341: 20793c2 1339: 86ffbfd 1335: e9755a6 1327: c27b2ed 1311: bec9816 1279: 4d166d8 v: v3
1 parent 349daa4 commit fe360ed

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ refs/heads/gh-pages: d1b373c30c176edc08692348167bec3a244bb823
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: dea33f5d017ff85c14573b4a06c6b1f2c4bbe2b0
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: 241960f2a24d4dbec27288589ccf72f91c431816
8+
refs/heads/update-datastore: 9e4692d3c7ee17b3f10f4073144fbab780bb63ea

branches/update-datastore/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ protected B self() {
122122
}
123123

124124
public B projectId(String projectId) {
125-
this.projectId = projectId;
125+
this.projectId =
126+
checkNotNull(projectId, "Project ID cannot be set to null. Leave unset for default.");
126127
return self();
127128
}
128129

branches/update-datastore/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/KeyFactory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.gcloud.datastore;
1818

19-
import com.google.common.base.MoreObjects;
2019
import com.google.common.collect.ImmutableList;
2120

2221
/**
@@ -29,14 +28,14 @@ public final class KeyFactory extends BaseKey.Builder<KeyFactory> {
2928
private final String ns;
3029

3130
public KeyFactory(String projectId) {
32-
this(projectId, null);
31+
this(projectId, "");
3332
}
3433

3534
public KeyFactory(String projectId, String namespace) {
3635
super(projectId);
3736
namespace(namespace);
3837
this.pi = projectId;
39-
this.ns = MoreObjects.firstNonNull(namespace, "");
38+
this.ns = namespace;
4039
}
4140

4241
public IncompleteKey newKey() {

branches/update-datastore/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/Validator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ static String validateDatabase(String projectId) {
4545
}
4646

4747
static String validateNamespace(String namespace) {
48-
if (Strings.isNullOrEmpty(namespace)) {
49-
return "";
50-
}
48+
checkArgument(namespace != null, "Namespace cannot be null. Leave unset for default.");
5149
checkArgument(namespace.length() <= MAX_NAMESPACE_LENGTH,
5250
"namespace must not contain more than 100 characters");
5351
checkArgument(NAMESPACE_PATTERN.matcher(namespace).matches(),

0 commit comments

Comments
 (0)