Skip to content

Commit 6ad9dbd

Browse files
committed
Address review feedback
1 parent 61ae02f commit 6ad9dbd

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

google-cloud-core-grpc/src/main/java/com/google/cloud/grpc/GrpcTransportOptions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.io.IOException;
3838
import java.io.ObjectInputStream;
3939
import java.util.Locale;
40-
import java.util.Locale.Category;
4140
import java.util.Objects;
4241
import java.util.concurrent.ExecutorService;
4342
import java.util.concurrent.ScheduledExecutorService;

google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseSelect.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public static void main(String... args) throws Exception {
5252
DatabaseClient dbClient = spanner.getDatabaseClient(DatabaseId.of(
5353
options.getProjectId(), instanceId, databaseId));
5454
// Queries the database
55-
ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of("SELECT 1"));
56-
57-
System.out.println("\n\nResults:");
58-
// Prints the results
59-
while (resultSet.next()) {
60-
System.out.printf("%d\n\n", resultSet.getLong(0));
55+
try (ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of("SELECT 1"))) {
56+
System.out.println("\n\nResults:");
57+
// Prints the results
58+
while (resultSet.next()) {
59+
System.out.printf("%d\n\n", resultSet.getLong(0));
60+
}
6161
}
6262
} finally {
6363
// Closes the client which will free up the resources used

google-cloud-spanner/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ started](https://cloud.google.com/spanner/docs/getting-started/java/) guide.
6767

6868
#### Complete source code
6969

70-
In [DatabaseSelect.java](../google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseSelect.java) we put a quick start example, which shows how you can run a simple select statement.
70+
In [DatabaseSelect.java](../google-cloud-examples/src/main/java/com/google/cloud/examples/spanner/snippets/DatabaseSelect.java) we put a quick start example, which shows how you can run a simple query.
7171

7272
## Troubleshooting
7373

google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GrpcSpannerRpc.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public GrpcSpannerRpc(SpannerOptions options) {
132132
TransportOptions transportOptions = options.getTransportOptions();
133133
// Note, getXGoogApiClientHeader() method can be added to TransportOptions directly.
134134
// Doing explicit casting here (instead of "contaminating" the top level interface) since most
135-
// probably it is a temporary solution (eventually all grpc clients whould become gapic-based,
135+
// probably it is a temporary solution (eventually all grpc clients will become gapic-based,
136136
// and gapic handles the header internally).
137137
if (transportOptions instanceof GrpcTransportOptions) {
138138
this.xGoogApiClientHeader =

0 commit comments

Comments
 (0)