Skip to content

Commit 0f1f777

Browse files
saturnismsduskis
authored andcommitted
---
yaml --- r: 22899 b: refs/heads/autosynth-bigquerystorage c: 3d009ca h: refs/heads/master i: 22897: a4fba2a 22895: aeef66d
1 parent 84e16c3 commit 0f1f777

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

  • branches/autosynth-bigquerystorage/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ refs/tags/v0.69.0: 78f67a29e8b9c46ba01de566a2eae0fd1c03edea
123123
refs/heads/autosynth-asset: 7d535c3023644faa89492d4a553d8c403e073fa7
124124
refs/heads/autosynth-automl: 7fcabb1e54ca9ded6bec10f41590d29ece3a6367
125125
refs/heads/autosynth-bigquerydatatransfer: d88aa5aae5fd9d3c6d75bbab1a05162c6d4d948f
126-
refs/heads/autosynth-bigquerystorage: bf3687b1c526aeaa55d31db80f0ef9a5906b1f0f
126+
refs/heads/autosynth-bigquerystorage: 3d009ca310a49f40f0fa5d7c7861dfc97da8121a
127127
refs/heads/autosynth-bigtable: 45891a7178142c84a16d6a0b792f8ecb950a3159
128128
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
129129
refs/heads/autosynth-containeranalysis: 0f377286f60df2b6fd37c183bf170c68dc014cfb

branches/autosynth-bigquerystorage/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/MetadataConfig.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ public static String getAttribute(String attributeName) {
7373
connection.setConnectTimeout(TIMEOUT_MS);
7474
connection.setReadTimeout(TIMEOUT_MS);
7575
connection.setRequestProperty("Metadata-Flavor", "Google");
76-
InputStream input = connection.getInputStream();
77-
if (connection.getResponseCode() == 200) {
78-
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
79-
return reader.readLine();
76+
try (InputStream input = connection.getInputStream()) {
77+
if (connection.getResponseCode() == 200) {
78+
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {
79+
return reader.readLine();
80+
}
8081
}
8182
}
8283
} catch (IOException ignore) {

0 commit comments

Comments
 (0)