From 4571f35759c738ee0070c6d80eecbfea89be94a0 Mon Sep 17 00:00:00 2001 From: Brad Corso Date: Thu, 5 Sep 2024 11:10:08 -0700 Subject: [PATCH] Remove calls to `Binding#bindingType()` from within the Resolver. We're currently refactoring the resolution logic to avoid things that require lookup of transitive dependencies, like the `BindingType`. Furthermore, for the usages in this CL, we shouldn't actually need the `BindingType` since just using the `BindingKind` should be sufficient. RELNOTES=N/A PiperOrigin-RevId: 671438774 --- java/dagger/internal/codegen/binding/BindingGraphFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/dagger/internal/codegen/binding/BindingGraphFactory.java b/java/dagger/internal/codegen/binding/BindingGraphFactory.java index 1a70870d059..a33ff6243dd 100644 --- a/java/dagger/internal/codegen/binding/BindingGraphFactory.java +++ b/java/dagger/internal/codegen/binding/BindingGraphFactory.java @@ -485,7 +485,7 @@ && getPreviouslyResolvedBindings(requestKey).isPresent() private Optional getOwningResolver(ContributionBinding binding) { // TODO(ronshapiro): extract the different pieces of this method into their own methods if ((binding.scope().isPresent() && binding.scope().get().isProductionScope()) - || binding.bindingType().equals(BindingType.PRODUCTION)) { + || binding.kind().equals(BindingKind.PRODUCTION)) { for (Resolver requestResolver : getResolverLineage()) { // Resolve @Inject @ProductionScope bindings at the highest production component. if (binding.kind().equals(INJECTION) @@ -758,7 +758,7 @@ private boolean requiresResolutionUncached(Key key) { private boolean requiresResolutionUncached(Binding binding) { if ((!binding.scope().isPresent() || binding.scope().get().isReusable()) // TODO(beder): Figure out what happens with production subcomponents. - && !binding.bindingType().equals(BindingType.PRODUCTION)) { + && !binding.kind().equals(BindingKind.PRODUCTION)) { for (DependencyRequest dependency : binding.dependencies()) { if (requiresResolution(dependency.key())) { return true;