Skip to content

Commit c53de82

Browse files
committed
Improves readability: Use boolean flags for source type check
1 parent 3e9d88d commit c53de82

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentialSource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ public IdentityPoolCredentialSource(Map<String, Object> credentialSourceMap) {
234234
"Only one credential source type can be set: 'file', 'url', or 'certificate'.");
235235
}
236236

237-
if (credentialSourceMap.containsKey("file")) {
237+
if (filePresent) {
238238
credentialLocation = (String) credentialSourceMap.get("file");
239239
credentialSourceType = IdentityPoolCredentialSourceType.FILE;
240-
} else if (credentialSourceMap.containsKey("url")) {
240+
} else if (urlPresent) {
241241
credentialLocation = (String) credentialSourceMap.get("url");
242242
credentialSourceType = IdentityPoolCredentialSourceType.URL;
243-
} else if (credentialSourceMap.containsKey("certificate")) {
243+
} else if (certificatePresent) {
244244
credentialSourceType = IdentityPoolCredentialSourceType.CERTIFICATE;
245245
this.certificateConfig = getCertificateConfig(credentialSourceMap);
246246
} else {

0 commit comments

Comments
 (0)