Skip to content

Commit 4db382f

Browse files
saturnismsduskis
authored andcommitted
---
yaml --- r: 26587 b: refs/heads/autosynth-securitycenter c: 3d009ca h: refs/heads/master i: 26585: f994810 26583: 40cea7e
1 parent da25744 commit 4db382f

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

  • branches/autosynth-securitycenter/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
@@ -169,7 +169,7 @@ refs/tags/v0.79.0: 82287b570708748c411d05c40f3932cff9606feb
169169
refs/tags/v0.80.0: f745e744d38e4fe636f34d0e04795ba3d014287d
170170
refs/tags/v0.81.0: ed3a0c85339ea6b73560b9a570abfbb76b93a263
171171
refs/heads/autosynth-dataproc: 812eb0e76f4543bffe59701872476c4b5b7415f5
172-
refs/heads/autosynth-securitycenter: bf3687b1c526aeaa55d31db80f0ef9a5906b1f0f
172+
refs/heads/autosynth-securitycenter: 3d009ca310a49f40f0fa5d7c7861dfc97da8121a
173173
refs/heads/autosynth-talent: 383a363aeb0af16c9997201d1f963360641f68a8
174174
refs/heads/cscc-samples: 620d105e6b574cfeeee04e413a157b7bd34ebc8b
175175
refs/heads/igorbernstein2-patch-1: f62464ee14df1e44a3b173cdc3976563d1b3078b

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