Skip to content

Commit d181d24

Browse files
saturnismsduskis
authored andcommitted
---
yaml --- r: 31183 b: refs/heads/autosynth-bigtable c: 3d009ca h: refs/heads/master i: 31181: 075ce3a 31179: ec1482b 31175: 61d16e3 31167: f026d56
1 parent e7adc83 commit d181d24

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ refs/heads/autosynth-asset: bdb45634a0fe8f7a510692b56b31f5312e25f453
124124
refs/heads/autosynth-automl: 22f9dd5b6f5df8dbfa7da0126864d565229519b2
125125
refs/heads/autosynth-bigquerydatatransfer: 71b6b6d2a992d05999b53e6e130c4fc1c8c8b4d7
126126
refs/heads/autosynth-bigquerystorage: a345f72d7a6358e9fea9dcdae94ec85a27da3088
127-
refs/heads/autosynth-bigtable: bf3687b1c526aeaa55d31db80f0ef9a5906b1f0f
127+
refs/heads/autosynth-bigtable: 3d009ca310a49f40f0fa5d7c7861dfc97da8121a
128128
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
129129
refs/heads/autosynth-containeranalysis: af5b804492292b43372c9fe00386696136ccae89
130130
refs/heads/autosynth-datastore: d0fc1187000c7a50d8bddd89c3b7cdf1187ecb96

branches/autosynth-bigtable/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)