Commit 216a9d2
Fix broken assertion in
Within `visitUncachedDependencies()` we assert that each uncached key is actually uncached before caching it. However, this assertion can fail because during the process of caching, we call `getLocalExplicitBindings()` and `getLocalMultibindingContributions()` which can trigger its own call to `visitUncachedDependencies()` and cache it first.
This CL fixes this issue by avoiding the calls to `getLocalExplicitBindings()` and `getLocalMultibindingContributions()`. In these cases we don't actually need the bindings themselves since we just need to know if the declarations exist or not, so we can just use the declarations directly. This saves us a bit of work because creating the binding requires us to not only resolve the binding itself, but also bindings for dependencies (possibly even transitive dependencies) in the case `@Binds` delegate declarations. It's also nice to keep the assertion because it gaurantees some simplicity to the code.
RELNOTES=N/A
PiperOrigin-RevId: 653633501RequiresResolutionChecker#visitUncachedDependencies()
1 parent 982dab4 commit 216a9d2
File tree
1 file changed
+16
-6
lines changed- java/dagger/internal/codegen/binding
1 file changed
+16
-6
lines changedLines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
| |||
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
870 | | - | |
871 | | - | |
872 | | - | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
873 | 876 | | |
874 | 877 | | |
875 | 878 | | |
| |||
886 | 889 | | |
887 | 890 | | |
888 | 891 | | |
889 | | - | |
890 | | - | |
| 892 | + | |
891 | 893 | | |
892 | 894 | | |
893 | 895 | | |
894 | 896 | | |
895 | 897 | | |
896 | 898 | | |
897 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
898 | 908 | | |
899 | 909 | | |
0 commit comments