@@ -117,15 +117,15 @@ private Optional<AwsCredentialsProvider> credentialsProvider(Set<String> childre
117117 */
118118 private Optional <CredentialsWithFeatureId > credentialsProviderWithFeatureID (Set <String > children ) {
119119 if (properties .containsKey (ProfileProperty .ROLE_ARN ) && properties .containsKey (ProfileProperty .WEB_IDENTITY_TOKEN_FILE )) {
120- return Optional .ofNullable (roleAndWebIdentityTokenProfileCredentialsProvider ());
120+ return Optional .of (roleAndWebIdentityTokenProfileCredentialsProvider ());
121121 }
122122
123123 if (properties .containsKey (ProfileProperty .SSO_ROLE_NAME )
124124 || properties .containsKey (ProfileProperty .SSO_ACCOUNT_ID )
125125 || properties .containsKey (ProfileProperty .SSO_REGION )
126126 || properties .containsKey (ProfileProperty .SSO_START_URL )
127127 || properties .containsKey (ProfileSection .SSO_SESSION .getPropertyKeyName ())) {
128- return Optional .ofNullable (ssoProfileCredentialsProvider ());
128+ return Optional .of (ssoProfileCredentialsProvider ());
129129 }
130130
131131 if (properties .containsKey (ProfileProperty .ROLE_ARN )) {
@@ -136,16 +136,16 @@ private Optional<CredentialsWithFeatureId> credentialsProviderWithFeatureID(Set<
136136 ProfileProperty .SOURCE_PROFILE , ProfileProperty .CREDENTIAL_SOURCE );
137137
138138 if (hasSourceProfile ) {
139- return Optional .ofNullable (roleAndSourceProfileBasedProfileCredentialsProvider (children ));
139+ return Optional .of (roleAndSourceProfileBasedProfileCredentialsProvider (children ));
140140 }
141141
142142 if (hasCredentialSource ) {
143- return Optional .ofNullable (roleAndCredentialSourceBasedProfileCredentialsProvider ());
143+ return Optional .of (roleAndCredentialSourceBasedProfileCredentialsProvider ());
144144 }
145145 }
146146
147147 if (properties .containsKey (ProfileProperty .CREDENTIAL_PROCESS )) {
148- return Optional .ofNullable (credentialProcessCredentialsProvider ());
148+ return Optional .of (credentialProcessCredentialsProvider ());
149149 }
150150
151151 if (properties .containsKey (ProfileProperty .AWS_SESSION_TOKEN )) {
0 commit comments