4141import com .google .common .base .MoreObjects ;
4242import com .google .common .collect .ImmutableList ;
4343import com .google .common .collect .ImmutableSet ;
44-
4544import java .io .IOException ;
4645import java .io .ObjectInputStream ;
4746import java .util .Collection ;
5857public class AppEngineCredentials extends GoogleCredentials implements ServiceAccountSigner {
5958
6059 private static final Logger LOGGER = Logger .getLogger (AppEngineCredentials .class .getName ());
61- private static final String APPLICATION_DEFAULT_CREDENTIALS_WARNING = "You are attempting to "
62- + "fetch Application Default Credentials from com.google.auth.appengine.AppEngineCredentials."
63- + " This method will not return a com.google.auth.appengine.AppEngineCredentials instance." ;
60+ private static final String APPLICATION_DEFAULT_CREDENTIALS_WARNING =
61+ "You are attempting to "
62+ + "fetch Application Default Credentials from com.google.auth.appengine.AppEngineCredentials."
63+ + " This method will not return a com.google.auth.appengine.AppEngineCredentials instance." ;
6464 private static final long serialVersionUID = -2627708355455064660L ;
6565
6666 private final String appIdentityServiceClassName ;
@@ -71,8 +71,9 @@ public class AppEngineCredentials extends GoogleCredentials implements ServiceAc
7171
7272 /**
7373 * {@inheritDoc}
74+ *
7475 * @deprecated AppEngineCredentials should be instantiated via its Builder. See
75- * https://github.com/googleapis/google-auth-library-java#google-auth-library-appengine
76+ * https://github.com/googleapis/google-auth-library-java#google-auth-library-appengine
7677 */
7778 @ Deprecated
7879 public static GoogleCredentials getApplicationDefault () throws IOException {
@@ -82,8 +83,9 @@ public static GoogleCredentials getApplicationDefault() throws IOException {
8283
8384 /**
8485 * {@inheritDoc}
86+ *
8587 * @deprecated AppEngineCredentials should be instantiated via its Builder. See
86- * https://github.com/googleapis/google-auth-library-java#google-auth-library-appengine
88+ * https://github.com/googleapis/google-auth-library-java#google-auth-library-appengine
8789 */
8890 @ Deprecated
8991 public static GoogleCredentials getApplicationDefault (HttpTransportFactory transportFactory )
@@ -94,15 +96,15 @@ public static GoogleCredentials getApplicationDefault(HttpTransportFactory trans
9496
9597 private AppEngineCredentials (Collection <String > scopes , AppIdentityService appIdentityService ) {
9698 this .scopes = scopes == null ? ImmutableSet .<String >of () : ImmutableList .copyOf (scopes );
97- this .appIdentityService = appIdentityService != null ? appIdentityService
98- : AppIdentityServiceFactory .getAppIdentityService ();
99+ this .appIdentityService =
100+ appIdentityService != null
101+ ? appIdentityService
102+ : AppIdentityServiceFactory .getAppIdentityService ();
99103 this .appIdentityServiceClassName = this .appIdentityService .getClass ().getName ();
100104 scopesRequired = this .scopes .isEmpty ();
101105 }
102106
103- /**
104- * Refresh the access token by getting it from the App Identity service
105- */
107+ /** Refresh the access token by getting it from the App Identity service */
106108 @ Override
107109 public AccessToken refreshAccessToken () throws IOException {
108110 if (createScopedRequired ()) {
@@ -113,7 +115,7 @@ public AccessToken refreshAccessToken() throws IOException {
113115 Date expirationTime = accessTokenResponse .getExpirationTime ();
114116 return new AccessToken (accessToken , expirationTime );
115117 }
116-
118+
117119 @ Override
118120 public boolean createScopedRequired () {
119121 return scopesRequired ;
0 commit comments