question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Throw if injecting Subcomponent.Builder without a provider

See original GitHub issue

Injecting Provider<SubcomponentInteface.Builder> lets you build a subcomponent. However, Dagger also lets you inject SubcomponentInterface.Builder directly, leading to concurrency bugs if subcomponents are created from the same partially initialized builder.

Dagger should make it impossible to inject Subcomponentinteface.Builder directly.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
cgdeckercommented, Mar 22, 2019

FWIW @Subcomponent.Factory, which should be in the next Dagger release, doesn’t have this issue.

0reactions
ronshapirocommented, Mar 25, 2019

I’m going to close this - @cgdecker’s point is a good one, and the SPI plugin should live outside of Dagger.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dagger: Is it possible to automatically expose Subcomponent ...
Yes, by specifying a component dependency, you can effectively have every "provision method" (zero-arg getter) on the target component added ...
Read more >
Hierarchical injectors - Angular
With hierarchical dependency injection, you can isolate sections of the application and ... If Angular still doesn't find the provider, it throws an...
Read more >
Dependency Injection with Dagger 2 - CodePath Cliffnotes
Subcomponent builders allow the creator of the subcomponent to be de-coupled from the parent component, by removing the need to have a subcomponent...
Read more >
Advanced Dagger Semantics
Dagger is a fully static, compile-time dependency injection framework for both Java and Android. It is developed by the Java Core Libraries Team...
Read more >
Dagger & Android Thoughts: Dependency Injection in Android
All subcomponents extend from the ApplicationComponent. Because of the above point, all the components will need to declare which modules they use without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found