Skip to content

Commit bf24c5b

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 1905 b: refs/heads/pubsub-alpha c: 6c40825 h: refs/heads/master i: 1903: a79561d
1 parent 3315897 commit bf24c5b

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ refs/heads/master: 689bbb466df4b2d5d2483d6edb8ac5c7c7f7c6fa
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
6-
refs/heads/pubsub-alpha: ad12f4143bbcb5d6557055452717c7380cf54959
6+
refs/heads/pubsub-alpha: 6c408256e1621c7e0f3640fb7a4ffdef139f5241
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
88
refs/heads/update-datastore: 482954f2c5055231e5b3122ea91d2ba00ce8187c
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

branches/pubsub-alpha/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package com.google.gcloud;
1818

1919
import static com.google.common.base.MoreObjects.firstNonNull;
20-
import static com.google.common.base.Preconditions.checkNotNull;
20+
import static com.google.common.base.Preconditions.checkArgument;
2121
import static java.nio.charset.StandardCharsets.UTF_8;
2222

2323
import com.google.api.client.extensions.appengine.http.UrlFetchTransport;
@@ -308,7 +308,10 @@ protected ServiceOptions(Class<? extends ServiceFactory<ServiceT, OptionsT>> ser
308308
Builder<ServiceT, ServiceRpcT, OptionsT, ?> builder) {
309309
projectId = builder.projectId != null ? builder.projectId : defaultProject();
310310
if (projectIdRequired()) {
311-
checkNotNull(projectId);
311+
checkArgument(
312+
projectId != null,
313+
"A project ID is required for this service but could not be determined from the builder or "
314+
+ "the environment. Please set a project ID using the builder.");
312315
}
313316
host = firstNonNull(builder.host, defaultHost());
314317
httpTransportFactory = firstNonNull(builder.httpTransportFactory,
@@ -334,7 +337,7 @@ protected ServiceOptions(Class<? extends ServiceFactory<ServiceT, OptionsT>> ser
334337
*
335338
* @return true if a project ID is required to use the service, false if not.
336339
*/
337-
public boolean projectIdRequired() {
340+
protected boolean projectIdRequired() {
338341
return true;
339342
}
340343

0 commit comments

Comments
 (0)