diff --git a/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java b/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java index 7d91a33ac..38bb45121 100644 --- a/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java +++ b/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java @@ -347,13 +347,15 @@ protected GoogleCredentials( } /** - * A helper for overriding toString that allows inheritance of super class fields - * Extending classes can override this implementation and call super implementation and then - * add more fields. Same cannot be done with ToString() directly. + * A helper for overriding toString that allows inheritance of super class fields Extending + * classes can override this implementation and call super implementation and then add more + * fields. Same cannot be done with ToString() directly. + * * @return an instance of the ToStringHelper that has all the relevant fields added */ protected ToStringHelper toStringHelper() { - return MoreObjects.toStringHelper(this).omitNullValues() + return MoreObjects.toStringHelper(this) + .omitNullValues() .add("quotaProjectId", quotaProjectId) .add("universeDomain", getUniverseDomain()); } diff --git a/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java b/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java index 907511d1c..5a82fd7e2 100644 --- a/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java +++ b/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java @@ -54,7 +54,6 @@ import com.google.auth.ServiceAccountSigner; import com.google.auth.http.HttpTransportFactory; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects.ToStringHelper; import com.google.common.collect.ImmutableSet; import java.io.IOException; @@ -763,18 +762,18 @@ public int hashCode() { @Override protected ToStringHelper toStringHelper() { - return super.toStringHelper() - .add("clientId", clientId) - .add("clientEmail", clientEmail) - .add("privateKeyId", privateKeyId) - .add("transportFactoryClassName", transportFactoryClassName) - .add("tokenServerUri", tokenServerUri) - .add("scopes", scopes) - .add("defaultScopes", defaultScopes) - .add("serviceAccountUser", serviceAccountUser) - .add("lifetime", lifetime) - .add("useJwtAccessWithScope", useJwtAccessWithScope) - .add("defaultRetriesEnabled", defaultRetriesEnabled); + return super.toStringHelper() + .add("clientId", clientId) + .add("clientEmail", clientEmail) + .add("privateKeyId", privateKeyId) + .add("transportFactoryClassName", transportFactoryClassName) + .add("tokenServerUri", tokenServerUri) + .add("scopes", scopes) + .add("defaultScopes", defaultScopes) + .add("serviceAccountUser", serviceAccountUser) + .add("lifetime", lifetime) + .add("useJwtAccessWithScope", useJwtAccessWithScope) + .add("defaultRetriesEnabled", defaultRetriesEnabled); } @Override diff --git a/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java b/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java index 2681df42e..4ed07b015 100644 --- a/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java +++ b/oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java @@ -1041,13 +1041,13 @@ public void equals_false_super() throws IOException { tokenServer1); OAuth2Credentials otherCredentials = ServiceAccountCredentials.fromPkcs8( - CLIENT_ID, - CLIENT_EMAIL, - PRIVATE_KEY_PKCS8, - PRIVATE_KEY_ID, - SCOPES, - serverTransportFactory, - tokenServer1) + CLIENT_ID, + CLIENT_EMAIL, + PRIVATE_KEY_PKCS8, + PRIVATE_KEY_ID, + SCOPES, + serverTransportFactory, + tokenServer1) .toBuilder() .setUniverseDomain("universe.com") .build(); @@ -1202,26 +1202,26 @@ public void hashCode_equals() throws IOException { MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); OAuth2Credentials credentials = ServiceAccountCredentials.fromPkcs8( - CLIENT_ID, - CLIENT_EMAIL, - PRIVATE_KEY_PKCS8, - PRIVATE_KEY_ID, - SCOPES, - transportFactory, - tokenServer) + CLIENT_ID, + CLIENT_EMAIL, + PRIVATE_KEY_PKCS8, + PRIVATE_KEY_ID, + SCOPES, + transportFactory, + tokenServer) .createWithQuotaProject(QUOTA_PROJECT) .toBuilder() .setUniverseDomain("universe.com") .build(); OAuth2Credentials otherCredentials = ServiceAccountCredentials.fromPkcs8( - CLIENT_ID, - CLIENT_EMAIL, - PRIVATE_KEY_PKCS8, - PRIVATE_KEY_ID, - SCOPES, - transportFactory, - tokenServer) + CLIENT_ID, + CLIENT_EMAIL, + PRIVATE_KEY_PKCS8, + PRIVATE_KEY_ID, + SCOPES, + transportFactory, + tokenServer) .createWithQuotaProject(QUOTA_PROJECT) .toBuilder() .setUniverseDomain("universe.com") @@ -1244,13 +1244,13 @@ public void hashCode_not_equals_quota() throws IOException { tokenServer); OAuth2Credentials otherCredentials = ServiceAccountCredentials.fromPkcs8( - CLIENT_ID, - CLIENT_EMAIL, - PRIVATE_KEY_PKCS8, - PRIVATE_KEY_ID, - SCOPES, - transportFactory, - tokenServer) + CLIENT_ID, + CLIENT_EMAIL, + PRIVATE_KEY_PKCS8, + PRIVATE_KEY_ID, + SCOPES, + transportFactory, + tokenServer) .createWithQuotaProject("some_quota"); assertNotEquals(credentials.hashCode(), otherCredentials.hashCode()); }