Skip to content

Commit

Permalink
Remove calls to Binding#bindingType() from within the Resolver.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bcorso authored and Dagger Team committed Sep 5, 2024
1 parent cca779a commit 4571f35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/dagger/internal/codegen/binding/BindingGraphFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ && getPreviouslyResolvedBindings(requestKey).isPresent()
private Optional<Resolver> 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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4571f35

Please sign in to comment.