Skip to content

Commit 7cd8cc1

Browse files
committed
format
1 parent 6293e19 commit 7cd8cc1

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ private static enum Environment {
8181
* <p>Returns the Application Default Credentials which are credentials that identify and
8282
* authorize the whole application. This is the built-in service account if running on Google
8383
* Compute Engine or the credentials file from the path in the environment variable
84-
* GOOGLE_APPLICATION_CREDENTIALS.
85-
* If the credentials have been cached, the cached credential will be returned.
84+
* GOOGLE_APPLICATION_CREDENTIALS. If the credentials have been cached, the cached credential will
85+
* be returned.
8686
*
8787
* @param transport the transport for Http calls.
8888
* @param jsonFactory the factory for Json parsing and formatting.
@@ -109,7 +109,8 @@ final GoogleCredential getDefaultCredential(HttpTransport transport, JsonFactory
109109
* @return the credential instance.
110110
* @throws IOException if the credential cannot be created in the current environment.
111111
*/
112-
final GoogleCredential getDefaultCredential(HttpTransport transport, JsonFactory jsonFactory, boolean resetCachedCredentials)
112+
final GoogleCredential getDefaultCredential(
113+
HttpTransport transport, JsonFactory jsonFactory, boolean resetCachedCredentials)
113114
throws IOException {
114115
synchronized (this) {
115116
if (cachedCredential == null || resetCachedCredentials) {

google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,16 @@ public static GoogleCredential getApplicationDefault() throws IOException {
181181
* authorize the whole application. This is the built-in service account if running on Google
182182
* Compute Engine or the credentials file from the path in the environment variable
183183
* GOOGLE_APPLICATION_CREDENTIALS.
184+
*
184185
* @param resetCachedCredentials whether to reset the cached credentials
185186
* @return the credential instance.
186187
* @throws IOException if the credential cannot be created in the current environment.
187188
*/
188189
@Beta
189-
public static GoogleCredential getApplicationDefault(boolean resetCachedCredentials) throws IOException {
190-
return getApplicationDefault(Utils.getDefaultTransport(), Utils.getDefaultJsonFactory(), resetCachedCredentials);
190+
public static GoogleCredential getApplicationDefault(boolean resetCachedCredentials)
191+
throws IOException {
192+
return getApplicationDefault(
193+
Utils.getDefaultTransport(), Utils.getDefaultJsonFactory(), resetCachedCredentials);
191194
}
192195

193196
/**
@@ -207,10 +210,12 @@ public static GoogleCredential getApplicationDefault(boolean resetCachedCredenti
207210
*/
208211
@Beta
209212
public static GoogleCredential getApplicationDefault(
210-
HttpTransport transport, JsonFactory jsonFactory, boolean resetCachedCredentials) throws IOException {
213+
HttpTransport transport, JsonFactory jsonFactory, boolean resetCachedCredentials)
214+
throws IOException {
211215
Preconditions.checkNotNull(transport);
212216
Preconditions.checkNotNull(jsonFactory);
213-
return defaultCredentialProvider.getDefaultCredential(transport, jsonFactory, resetCachedCredentials);
217+
return defaultCredentialProvider.getDefaultCredential(
218+
transport, jsonFactory, resetCachedCredentials);
214219
}
215220

216221
/**
@@ -607,7 +612,9 @@ public Builder setJsonFactory(JsonFactory jsonFactory) {
607612
return (Builder) super.setJsonFactory(jsonFactory);
608613
}
609614

610-
/** @since 1.9 */
615+
/**
616+
* @since 1.9
617+
*/
611618
@Override
612619
public Builder setClock(Clock clock) {
613620
return (Builder) super.setClock(clock);

google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/DefaultCredentialProviderTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public void testDefaultCredentialAppEngineDeployed() throws IOException {
8787
assertSame(JSON_FACTORY, defaultCredential.getJsonFactory());
8888
}
8989

90-
9190
public void testGetApplicationDefaultResetCacheTrueReturnsNewCredentials() throws IOException {
9291
TestDefaultCredentialProvider testProvider = new TestDefaultCredentialProvider();
9392
HttpTransport transport = new MockHttpTransport();

0 commit comments

Comments
 (0)