From cbd1b26de2010578a833ab9c54180c5b437b211b Mon Sep 17 00:00:00 2001 From: aozarov Date: Thu, 30 Jul 2015 15:18:41 -0700 Subject: [PATCH] 1. Fix issue #121 and replace default_project_id environment name with GCLOUD_PROJECT 2. Fix a null pointer bug with listing 3. Update maven dependencies --- .../com/google/gcloud/ServiceOptions.java | 2 +- .../google/gcloud/storage/StorageImpl.java | 4 ++- pom.xml | 28 +++++++++---------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java b/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java index cd529ba14187..59c2d57fb3df 100644 --- a/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java +++ b/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java @@ -52,7 +52,7 @@ public abstract class ServiceOptions< private static final String DEFAULT_HOST = "https://www.googleapis.com"; private static final long serialVersionUID = 1203687993961393350L; - private static final String PROJECT_ENV_NAME = "default_project_id"; + private static final String PROJECT_ENV_NAME = "GCLOUD_PROJECT"; private final String projectId; private final String host; diff --git a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java index 6eb8e3359a4d..f59c6c670969 100644 --- a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java +++ b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java @@ -175,7 +175,9 @@ private static abstract class BasePageFetcher Map optionMap) { this.serviceOptions = serviceOptions; ImmutableMap.Builder builder = ImmutableMap.builder(); - builder.put(StorageRpc.Option.PAGE_TOKEN, cursor); + if (cursor != null) { + builder.put(StorageRpc.Option.PAGE_TOKEN, cursor); + } for (Map.Entry option : optionMap.entrySet()) { if (option.getKey() != StorageRpc.Option.PAGE_TOKEN) { builder.put(option.getKey(), option.getValue()); diff --git a/pom.xml b/pom.xml index c824895e6c9a..d9c12c4cc505 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ org.codehaus.mojo exec-maven-plugin - 1.3.2 + 1.4.0 true java @@ -125,7 +125,7 @@ org.codehaus.mojo exec-maven-plugin - 1.3.2 + 1.4.0 @@ -156,7 +156,7 @@ maven-jar-plugin - 2.5 + 2.6 true @@ -200,7 +200,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.1 + 2.10.3 attach-javadocs @@ -213,7 +213,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 1.6 sign-artifacts @@ -227,7 +227,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.3 + 1.6.5 true sonatype-nexus-staging @@ -238,7 +238,7 @@ org.eluder.coveralls coveralls-maven-plugin - 3.0.1 + 3.1.0 ${basedir}/target/coverage.xml @@ -248,7 +248,7 @@ org.codehaus.mojo cobertura-maven-plugin - 2.6 + 2.7 ${basedir}/target @@ -271,12 +271,12 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.13 + 2.16 com.puppycrawl.tools checkstyle - 6.2 + 6.8.1 @@ -331,7 +331,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.1 + 2.10.3 html @@ -355,7 +355,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.13 + 2.16 checkstyle.xml false @@ -364,7 +364,7 @@ org.codehaus.mojo cobertura-maven-plugin - 2.6 + 2.7 true @@ -375,7 +375,7 @@ com.github.github site-maven-plugin - 0.10 + 0.12 Creating site for ${project.artifactId} ${project.version} ${project.distributionManagement.site.url}