Skip to content

Commit bc19d79

Browse files
mrdziubancopybara-github
authored andcommitted
Copybara import of the project:
-- 978c946 by Matt Dziuban <mrdziuban@gmail.com>: fix: Use `orElseGet` to defer loading of default credentials. COPYBARA_INTEGRATE_REVIEW=#124 from mrdziuban:fix-default-credentials 978c946 PiperOrigin-RevId: 743689191
1 parent 8c8a96f commit bc19d79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/google/genai/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ abstract class ApiClient {
104104
throw new IllegalArgumentException("Location must not be empty.");
105105
}
106106

107-
this.credentials = Optional.of(credentials.orElse(defaultCredentials()));
107+
this.credentials = Optional.of(credentials.orElseGet(() -> defaultCredentials()));
108108

109109
this.httpOptions = defaultHttpOptions(/* vertexAI= */ true, this.location);
110110

0 commit comments

Comments
 (0)