Skip to content

Commit 98686e4

Browse files
committed
---
yaml --- r: 1203 b: refs/heads/master c: cf777fc h: refs/heads/master i: 1201: f5372be 1199: 0c82fa5 v: v3
1 parent 150f014 commit 98686e4

6 files changed

Lines changed: 13 additions & 24 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
refs/heads/master: b7099e073380d0ea1061470bb4120efeec3d00e1
2+
refs/heads/master: cf777fcaa578ebeace11dff3b75e774c9874c9a9
33
refs/heads/travis: 0fa997e2fc9c6b61b2d91e6d163655aae67d44b6
44
refs/heads/gh-pages: 5a10432ecc75f29812e33a8236c900379509fe99

trunk/RELEASING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ This script takes an optional argument denoting the new version. By default, if
1010
2. Create a PR to update the pom.xml version.
1111
The PR should look something like [#225](https://github.com/GoogleCloudPlatform/gcloud-java/pull/225). After this PR is merged into GoogleCloudPlatform/gcloud-java, Travis CI will push a new website to GoogleCloudPlatform/gh-pages, push a new artifact to the Maven Central Repository, and update versions in the README files.
1212

13-
3. Before moving on, verify that the artifacts have successfully been pushed to the Maven Central Repository. To do this, we need to check the Travis CI logs since the artifacts take a couple hours to appear on the Maven Central Repository's website. Open Travis CI, click the ["Build History" tab](https://travis-ci.org/GoogleCloudPlatform/gcloud-java/builds), and open the second build's logs for Step 2's PR. Be sure that you are not opening the "Pull Request" build logs; you should not be under the "Pull Requests" tab. When the build finishes, scroll to the end of the log and verify that the artifacts were successfully staged and deployed. If the deployment didn't succeed because of a flaky test, the artifact may still have been pushed by the next Travis build, "Updating READMEs." If both builds failed to deploy the artifacts, rerun the build.
14-
15-
4. Create a release on Github manually.
13+
3. Create a release on Github manually.
1614
Go to the [releases page](https://github.com/GoogleCloudPlatform/gcloud-java/releases) and click "Draft a new release." Use `vX.Y.Z` as the "Tag Version" and `X.Y.Z` as the "Release Title", where `X.Y.Z` is the release version as listed in the `pom.xml` files.
1715

18-
5. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
16+
4. Run `utilities/update_pom_version.sh` again (to include "-SNAPSHOT" in the project version).
1917
As mentioned before, there is an optional version argument. By default, the script will update the version from "X.Y.Z" to "X.Y.Z+1-SNAPSHOT". Suppose a different version is desired, for example X+1.0.0-SNAPSHOT. Then the appropriate command to run would be `utilities/update_pom_version.sh X+1.0.0-SNAPSHOT`.
2018

21-
6. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).
19+
5. Create and merge in another PR to reflect the updated project version. For an example of what this PR should look like, see [#227](https://github.com/GoogleCloudPlatform/gcloud-java/pull/227).
2220

2321
### To push a snapshot version
2422

trunk/gcloud-java-core/src/main/java/com/google/gcloud/ServiceOptions.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,9 @@ protected static String getAppEngineProjectId() {
450450
try {
451451
Class<?> factoryClass =
452452
Class.forName("com.google.appengine.api.appidentity.AppIdentityServiceFactory");
453-
Class<?> serviceClass =
454-
Class.forName("com.google.appengine.api.appidentity.AppIdentityService");
455453
Method method = factoryClass.getMethod("getAppIdentityService");
456454
Object appIdentityService = method.invoke(null);
457-
method = serviceClass.getMethod("getServiceAccountName");
455+
method = appIdentityService.getClass().getMethod("getServiceAccountName");
458456
String serviceAccountName = (String) method.invoke(appIdentityService);
459457
int indexOfAtSign = serviceAccountName.indexOf('@');
460458
return serviceAccountName.substring(0, indexOfAtSign);

trunk/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/package-info.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
/**
1818
* A client to the Google Cloud Datastore.
1919
*
20-
* <p>Here's a simple usage example for using gcloud-java from App/Compute Engine:
20+
* <p>A simple usage example:
2121
* <pre> {@code
22-
* Datastore datastore = DatastoreOptions.defaultInstance().service();
22+
* DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build();
23+
* Datastore datastore = options.service();
2324
* KeyFactory keyFactory = datastore.newKeyFactory().kind(kind);
2425
* Key key = keyFactory.newKey(keyName);
2526
* Entity entity = datastore.get(key);
@@ -46,11 +47,6 @@
4647
* }
4748
* } </pre>
4849
*
49-
* <p>When using gcloud-java from outside of App/Compute Engine, you have to <a
50-
* href="https://github.com/GoogleCloudPlatform/gcloud-java#specifying-a-project-id">specify a
51-
* project ID</a> and
52-
* <a href="https://github.com/GoogleCloudPlatform/gcloud-java#authentication">provide
53-
* credentials</a>.
5450
* @see <a href="https://cloud.google.com/datastore/">Google Cloud Datastore</a>
5551
*/
5652
package com.google.gcloud.datastore;

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/spi/DefaultStorageRpc.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import com.google.common.base.MoreObjects;
6161
import com.google.common.collect.ImmutableSet;
6262
import com.google.common.collect.Maps;
63+
import com.google.common.primitives.Ints;
6364
import com.google.gcloud.storage.StorageException;
6465
import com.google.gcloud.storage.StorageOptions;
6566

@@ -415,7 +416,7 @@ public byte[] read(StorageObject from, Map<Option, ?> options, long position, in
415416
.setIfGenerationMatch(IF_GENERATION_MATCH.getLong(options))
416417
.setIfGenerationNotMatch(IF_GENERATION_NOT_MATCH.getLong(options));
417418
MediaHttpDownloader downloader = req.getMediaHttpDownloader();
418-
downloader.setContentRange(position, (int) position + bytes);
419+
downloader.setContentRange(position, Ints.checkedCast(position + bytes - 1));
419420
downloader.setDirectDownloadEnabled(true);
420421
ByteArrayOutputStream output = new ByteArrayOutputStream();
421422
req.executeMediaAndDownloadTo(output);

trunk/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
/**
1818
* A client to Google Cloud Storage.
1919
*
20-
* <p>Here's a simple usage example for using gcloud-java from App/Compute Engine:
20+
* <p>A simple usage example:
2121
* <pre>{@code
22-
* Storage storage = StorageOptions.defaultInstance().service();
22+
* StorageOptions options = StorageOptions.builder().projectId("project").build();
23+
* Storage storage = options.service();
2324
* BlobId blobId = BlobId.of("bucket", "blob_name");
2425
* Blob blob = Blob.load(storage, blobId);
2526
* if (blob == null) {
@@ -34,11 +35,6 @@
3435
* channel.close();
3536
* }}</pre>
3637
*
37-
* When using gcloud-java from outside of App/Compute Engine, you have to <a
38-
* href="https://github.com/GoogleCloudPlatform/gcloud-java#specifying-a-project-id">specify a
39-
* project ID</a> and
40-
* <a href="https://github.com/GoogleCloudPlatform/gcloud-java#authentication">provide
41-
* credentials</a>.
4238
* @see <a href="https://cloud.google.com/storage/">Google Cloud Storage</a>
4339
*/
4440
package com.google.gcloud.storage;

0 commit comments

Comments
 (0)