mirror of
https://github.com/google/nomulus
synced 2026-01-06 21:47:31 +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:
@@ -27,6 +27,7 @@ import static google.registry.request.RequestParameters.extractSetOfParameters;
|
||||
import com.google.appengine.api.taskqueue.Queue;
|
||||
import com.google.appengine.api.taskqueue.QueueFactory;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@@ -42,13 +43,11 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/** Dagger module for the dns package. */
|
||||
@Module
|
||||
public final class DnsModule {
|
||||
public abstract class DnsModule {
|
||||
|
||||
@Provides
|
||||
@Binds
|
||||
@DnsWriterZone
|
||||
static String provideZoneName(@Parameter(RequestParameters.PARAM_TLD) String tld) {
|
||||
return tld;
|
||||
}
|
||||
abstract String provideZoneName(@Parameter(RequestParameters.PARAM_TLD) String tld);
|
||||
|
||||
@Provides
|
||||
@Named(DNS_PULL_QUEUE_NAME)
|
||||
|
||||
Reference in New Issue
Block a user