Skip to content

Commit a180786

Browse files
saturnismsduskis
authored andcommitted
---
yaml --- r: 28143 b: refs/heads/autosynth-spanner c: 3d009ca h: refs/heads/master i: 28141: 35d750f 28139: ddd7c88 28135: 3e6340c 28127: a743975
1 parent e59b7f1 commit a180786

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
@@ -137,7 +137,7 @@ refs/heads/autosynth-language: e73905aa7672afa47240e65b25c087207f4594f9
137137
refs/heads/autosynth-os-login: 123ba209c5769d0ee067e0ce5848bec13b42a4f4
138138
refs/heads/autosynth-redis: 6bedce4d7c7c6ca6a22e83ad1780e08fdc565a9e
139139
refs/heads/autosynth-scheduler: 57f9fdb1e7de30c85f4ec7198931a07f50603e55
140-
refs/heads/autosynth-spanner: bf3687b1c526aeaa55d31db80f0ef9a5906b1f0f
140+
refs/heads/autosynth-spanner: 3d009ca310a49f40f0fa5d7c7861dfc97da8121a
141141
refs/heads/autosynth-speech: 64692f6db11364f663921be02c08072b966b6e7b
142142
refs/heads/autosynth-tasks: eb03eeab747e925175890db923945384d89b273a
143143
refs/heads/autosynth-texttospeech: 2c442fe0b7f089fbab266edfe4dd83c532e82dd0

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