Skip to content

Commit 9463df4

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 3191 b: refs/heads/master c: 02a56a8 h: refs/heads/master i: 3189: cb904f3 3187: 90b2a0d 3183: 0b6e1ae
1 parent b598a52 commit 9463df4

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: af6ab8f227fb4a877973bbc03be69770bc38af2c
2+
refs/heads/master: 02a56a831bd04734dd171a553dc569637d2059c6
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b

trunk/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

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/KeyFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public final class KeyFactory extends BaseKey.Builder<KeyFactory> {
2929
private final String ns;
3030

3131
public KeyFactory(String projectId) {
32-
this(projectId, null);
32+
this(projectId, "");
3333
}
3434

3535
public KeyFactory(String projectId, String namespace) {

trunk/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)