mirror of
https://github.com/google/nomulus
synced 2026-04-22 01:00:44 +00:00
Migrate @Provides methods to @Binds methods where possible.
@Binds is a much more efficient way to delegate one binding to another in that:
* The @Binds method does not need to be invoked
* It does not generate an additional Provider implementation
* An additional Provider does does not need to be instantiated
Future changes to Dagger's component processor will add even further benefits.
More information: []
ATTENTION REVIEWERS: This migration is being done with global approval. Per-project approval is not required.
Tested:
TAP train for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125980758
This commit is contained in:
@@ -32,6 +32,7 @@ import com.google.appengine.api.urlfetch.URLFetchServiceFactory;
|
||||
import com.google.appengine.api.users.UserService;
|
||||
import com.google.appengine.api.users.UserServiceFactory;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@@ -138,11 +139,9 @@ public final class Modules {
|
||||
* <p>You must also use the {@link AppIdentityCredential} module.
|
||||
*/
|
||||
@Module
|
||||
public static final class UseAppIdentityCredentialForGoogleApisModule {
|
||||
@Provides
|
||||
static HttpRequestInitializer provideHttpRequestInitializer(AppIdentityCredential credential) {
|
||||
return credential;
|
||||
}
|
||||
public abstract static class UseAppIdentityCredentialForGoogleApisModule {
|
||||
@Binds
|
||||
abstract HttpRequestInitializer provideHttpRequestInitializer(AppIdentityCredential credential);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user