File tree Expand file tree Collapse file tree
gcloud-java-core/src/main/java/com/google/gcloud
gcloud-java-datastore/src/main/java/com/google/gcloud/datastore Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60- refs/heads/tswast-patch-1: af6ab8f227fb4a877973bbc03be69770bc38af2c
60+ refs/heads/tswast-patch-1: 02a56a831bd04734dd171a553dc569637d2059c6
6161refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 (),
You can’t perform that action at this time.
0 commit comments