Skip to content

Commit 89e5c46

Browse files
committed
fix DoubleBraceInitialization failure
1 parent fa72753 commit 89e5c46

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/InternalAwsSecurityCredentialsSupplier.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,8 @@ Map<String, Object> createMetadataRequestHeaders(AwsCredentialSource awsCredenti
235235
// Both flows work for IDMS v1 and v2. But if IDMSv2 is enabled, then if
236236
// session token is not present, Unauthorized exception will be thrown.
237237
if (awsCredentialSource.imdsv2SessionTokenUrl != null) {
238-
Map<String, Object> tokenRequestHeaders =
239-
new HashMap<String, Object>() {
240-
{
241-
put(AWS_IMDSV2_SESSION_TOKEN_TTL_HEADER, AWS_IMDSV2_SESSION_TOKEN_TTL);
242-
}
243-
};
238+
Map<String, Object> tokenRequestHeaders = new HashMap<>();
239+
tokenRequestHeaders.put(AWS_IMDSV2_SESSION_TOKEN_TTL_HEADER, AWS_IMDSV2_SESSION_TOKEN_TTL);
244240

245241
String imdsv2SessionToken =
246242
retrieveResource(

0 commit comments

Comments
 (0)