Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from moe writing branch from 9f986abd0f985e717dde1476aeaf058df50064ff #229

Merged
Merged
Changes from 1 commit
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
1e87aff
Un-secret jesse beder's username
cgruber Oct 20, 2015
096293d
Replace use of deprecated Futures.fallback with Futures.catching.
jbeder Apr 7, 2015
6a39810
Automated g4 rollback of changelist 90533797.
jbeder Apr 7, 2015
487124f
Create an internal test that generates the open-source project and ex…
cgruber Jun 2, 2015
4692153
Add documentation for multibindings.
netdpb Jul 15, 2015
8b59848
Automated g4 rollback of changelist 98344654.
gk5885 Jul 15, 2015
36fc8bf
Dagger build optimization
matvore Jul 16, 2015
ff589dd
Ensure that all sources emitted by Dagger are formatted with the Goog…
gk5885 Jul 16, 2015
5721a93
Roll forward refactoring into ModuleDescriptor but without the refere…
gk5885 Jul 16, 2015
8043a6b
Automated g4 rollback of changelist 98411635.
brettchabot Jul 16, 2015
9e4d56c
Remove usage of an internal API not released in Guava.
gk5885 Jul 16, 2015
9230291
Add value semantics to Produced.
jbeder Jul 16, 2015
de9434d
First step at refactoring ComponentGenerator: Move methods to new cla…
netdpb Jul 21, 2015
980d789
Extract logic to find snippets for binding keys to a new method, getM…
netdpb Jul 21, 2015
d905efd
Roll forward the CL to format sources now that issues with the old Gu…
gk5885 Jul 21, 2015
582d7e2
Extract logic to find snippets for multibinding contributions to a ne…
netdpb Jul 21, 2015
d92a2e9
Clean up the Lazy javadoc to fix some escaping issues, remove referen…
gk5885 Jul 21, 2015
8ea1f70
Strip out internal documentation references which open-source users w…
netdpb Jul 21, 2015
bd34128
Small simplification: Almost all calls to getMemberSelectSnippet(Bind…
netdpb Jul 22, 2015
0a26233
Work around a type inference change in javac
cushon Jul 22, 2015
6bb61e2
Move the findLocalAndInheritedMethods method out of AutoValueProcesso…
eamonnmcmanus Jul 23, 2015
96559bb
Added support for cyclic dependencies via Provider/Lazy indirection.
Oct 7, 2015
f025531
Make subcomponent bindings that depend transitively on multibindings …
netdpb Jul 27, 2015
e5a432a
Add test that asserts that elements of multibindings that depend on s…
netdpb Jul 30, 2015
4e71c38
Small refactoring of ComponentWriter to extract a couple of methods.
netdpb Jul 30, 2015
623de2d
Adding the JSR-330 TCK tests in their original form, without any BUIL…
Jul 31, 2015
d29b34f
Fixes to enable compilation with a stock javac9
cushon Jan 8, 2015
b2f8d14
Make component contributions available to subcomponents as fields dir…
netdpb Aug 4, 2015
3a19fa4
Refactor ComponentWriter to pull common logic up.
netdpb Aug 4, 2015
76e0747
Make sure that elements of multibindings that depend on subcomponent-…
netdpb Aug 4, 2015
ff07f80
Clean up ValidationReport to make it a bit more useful. This includes:
gk5885 Aug 5, 2015
993ffc8
Subcomponents no longer generate DelegateFactory's for providers alre…
Aug 5, 2015
371b187
Defer processing component type elements when their ComponentDescript…
netdpb Aug 5, 2015
482cbd4
Report an error if more than one contribution to a map multibinding u…
netdpb Aug 7, 2015
3429bcd
Adding error messages for @Inject annotations on static members
Aug 7, 2015
c9c47ef
Remove JSR-330 TCK tests from dagger as we'll run the TCK directly ag…
Aug 7, 2015
287b537
Adding compiler flags for private and static member validation types
Aug 11, 2015
67c8797
Don't recurse infinitely on valid cycles when checking whether a bind…
netdpb Aug 12, 2015
238cc65
Fixed overridden @Inject methods
Aug 15, 2015
2916047
Dagger now runs the JSR-330 TCK tests
Aug 15, 2015
bf8c410
Fixes a bug where checking if a cycle is legitimate (contains provide…
Aug 15, 2015
6999764
Added support for supressing dependency-cycle warnings for cycles tha…
Aug 15, 2015
14527d5
Automated g4 rollback of changelist 100722956.
netdpb Aug 17, 2015
63197ef
Use Ascii.toUpperCase because we're only dealing with ascii and toUpp…
gk5885 Aug 20, 2015
e666753
Clear the InjectBindingRegistry cache after each round of processing.…
netdpb Aug 20, 2015
578659d
Write annotations for constructors and variables.
netdpb Aug 20, 2015
1615a15
Recognize a dependency request on an instance of Map<K, Provider<V>> …
netdpb Aug 21, 2015
2c0fe84
Validate that modules installed in both parent and child components n…
gk5885 Aug 21, 2015
a0e882e
Fix a typo in a comment.
gk5885 Aug 21, 2015
092bf2d
Automated g4 rollback of changelist 101240482.
gk5885 Aug 24, 2015
49b4cd5
Fixed overridden @Inject methods
netdpb Aug 24, 2015
7fe2dda
Reject component elements if they can't even be validated because of …
netdpb Aug 24, 2015
0485756
Reduce some duplication in Functions that get BindingKeys from Depend…
gk5885 Aug 24, 2015
cb735ad
Fix generated code for producers set bindings.
jbeder Aug 25, 2015
924b5f4
Add the owning component to ResolvedBindings. This allows for compon…
gk5885 Aug 25, 2015
3a5e81e
Validate that modules installed in both parent and child components n…
gk5885 Aug 25, 2015
15a1fe0
Fix the DependencyRequestMapperTest by replacing MembersInjector<Inte…
jbeder Aug 25, 2015
1c6d534
Fix validation error for ProducerModules including Modules.
jbeder Aug 26, 2015
8abb011
Add interfaces for monitoring producers.
jbeder Jul 17, 2015
24441d1
Eagerly generate members injectors for classes with @Inject construct…
jbeder Aug 27, 2015
818599e
When using @Lazy on an element that also has a scope, DCL happens twi…
jnlopar Jul 7, 2015
a3f010f
Fix class references in various writers, which didn't account for ann…
jbeder Sep 2, 2015
9eaebb3
Fix bug in componentWithScopeMayDependOnOnlyOneScopedComponent test
paulduffin Sep 9, 2015
667323a
Added validation check to detect cycles in component dependencies
paulduffin Sep 14, 2015
e4b5d2f
Add standard MapKey annotations.
netdpb Sep 14, 2015
238678f
Fix a typo.
gk5885 Sep 14, 2015
68f060a
Set the DelegateFactories' delegates only after the real factory is c…
netdpb Sep 15, 2015
a359478
Add monitoring to generated producer factories.
jbeder Sep 15, 2015
fb7a9d4
Validate that only one annotation type is used for all contributions …
netdpb Sep 15, 2015
9b81e10
Prune modules that do not provide bindings that require a module inst…
gk5885 Sep 15, 2015
89ede44
Remove the local "value" variable in the generated ProducerFactory.
jbeder Sep 15, 2015
bb53199
Allow multibindings with qualifiers that have members.
netdpb Sep 16, 2015
a8a1d12
Create class to represent a scope
paulduffin Sep 17, 2015
60423d4
Reduce visiblity or make final protected methods that are not used/ov…
gk5885 Sep 17, 2015
e595606
Address an issue in which pruned modules that were still referenced i…
gk5885 Sep 18, 2015
d82db0c
Simplify some type variable stuff.
cushon Sep 22, 2015
fdf1a9e
Minor change to how ClassName handles the "$" separator
paulduffin Sep 24, 2015
ba28f41
Refactor to make looking up implicit map bindings clearer.
netdpb Sep 24, 2015
3b34ab0
Add non-throwing monitor implementation to protect producer code from…
jbeder Sep 25, 2015
1f57aec
Replace Producers.submitToExecutor with Futures.transform from an imm…
jbeder Sep 25, 2015
6bd55de
Resolve differences among ProvisionBinding, ProductionBinding, and Me…
netdpb Sep 28, 2015
a4ff5ba
Fix a typo in a comment.
gk5885 Sep 30, 2015
6583420
Implement injecting Set<Produced<T>> for a producer set binding.
jbeder Sep 30, 2015
be842fd
Change the way that the component writer manages state when adding fi…
gk5885 Oct 1, 2015
8137496
Fix error reporting for missing qualified bindings by including the q…
netdpb Oct 1, 2015
90b72c8
Change initilization to collect Snippets and separately write them in…
gk5885 Jul 26, 2015
1beaa51
More javac9 type inference fixes
cushon Oct 5, 2015
7c3ff29
Resolve all unchecked-cast warnings in ResolvedBindings by making exp…
netdpb Oct 6, 2015
730ea9b
Fixed problem with multibound maps whose values are arrays, introduce…
netdpb Oct 7, 2015
01bc0ee
Remove the enumBindingKeys set. It was tracking a bit of state that …
gk5885 Oct 8, 2015
4b38950
Cleanup change generated by Refaster ([] to directories third_party/j…
netdpb Oct 8, 2015
e810673
Make @Subcomponent have runtime retention, just like @Component.
netdpb Oct 8, 2015
a95bfd2
Cleaned up a bunch of warnings.
netdpb Oct 8, 2015
c5d2e65
Make a constant final.
gk5885 Oct 9, 2015
b48a937
Rename Dagger-Producers functional tests top-level package to avoid n…
netdpb Oct 12, 2015
6bdd487
Add support for ProductionComponent builders.
jbeder Oct 12, 2015
adf8ed4
Delete the unused DependencyRequest.Factory.forImplicitProductionSetB…
jbeder Oct 13, 2015
95c9b6f
Change Monitors.delegatingProductionComponentMonitorFactory to return…
jbeder Oct 16, 2015
0a2ca81
Stop using deprecated Futures method.
netdpb Jul 18, 2015
0408ca8
Bump dependencies (and add some) to enable the open-source build syst…
cgruber Oct 20, 2015
d7fa773
Force a validation test to be ignored in the open-source maven build …
cgruber Oct 20, 2015
0e6f248
Hook up the ProductionComponentMonitor.
jbeder Oct 23, 2015
6767ed5
Clarify the javadoc of ProducerMonitor in the case when a producer is…
jbeder Oct 26, 2015
1505feb
Make InjectProcessingStep defer incomplete types
jart Oct 27, 2015
28032ee
Use raw types rather than package proxies. In addition to being more…
gk5885 Oct 28, 2015
191de01
Remove ProxyClassAndField as it is no longer used.
gk5885 Oct 29, 2015
5dcbd96
Small refactor to simplify Resolver.lookupBindings.
netdpb Nov 3, 2015
e424d92
Only write and initialize fields in subcomponents for bindings that a…
netdpb Nov 3, 2015
a6ac28b
Fix Dagger maven build for android examples
ronshapiro Nov 4, 2015
fa92875
Make subcomponents not have instance fields for modules with only sta…
netdpb Nov 5, 2015
6a2237a
Update changelog with dagger 2 information, and reformat.
cgruber Nov 9, 2015
93c9abf
Remove package sealing certs from the jars when they're shaded up, si…
cgruber Nov 10, 2015
a012aa2
Update the poms to incorporate the jsr-330 TCK test dep, so that part…
cgruber Nov 10, 2015
b99ae8e
Remove restriction around generating classes in lowerCamelCase.
ronshapiro Nov 10, 2015
99d6408
Make it possible to depend on subcomponent builders.
netdpb Nov 12, 2015
2049b2c
Use a flag formulation that is compatible with standard javac.
gk5885 Nov 12, 2015
91f7d8b
Bump the android API/tools version to 23.
cgruber Nov 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Small refactor to simplify Resolver.lookupBindings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=106950444
  • Loading branch information
netdpb authored and cgruber committed Nov 12, 2015
commit 5dcbd968a59d02aaeed563659564b7dad92c708e
19 changes: 13 additions & 6 deletions compiler/src/main/java/dagger/internal/codegen/BindingGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,7 @@ ResolvedBindings lookUpBindings(DependencyRequest request) {
ImmutableSetMultimap.builder();
for (ContributionBinding binding :
union(explicitBindingsForKey, union(explicitSetBindings, explicitMapBindings))) {
if (isResolvedInParent(request, binding)
&& !shouldOwnParentBinding(request, binding)) {
bindings.put(getOwningResolver(binding).get().componentDescriptor, binding);
} else {
bindings.put(componentDescriptor, binding);
}
bindings.put(getOwningComponent(request, binding), binding);
}
return ResolvedBindings.forContributionBindings(
bindingKey, componentDescriptor, bindings.build());
Expand Down Expand Up @@ -383,6 +378,18 @@ && isResolvedInParent(request, provisionBinding.get())
}
}

/**
* If {@code binding} should be owned by a parent component, resolves the binding in that
* component's resolver and returns that component. Otherwise returns the component for this
* resolver.
*/
private ComponentDescriptor getOwningComponent(
DependencyRequest request, ContributionBinding binding) {
return isResolvedInParent(request, binding) && !shouldOwnParentBinding(request, binding)
? getOwningResolver(binding).get().componentDescriptor
: componentDescriptor;
}

/**
* Returns {@code true} if {@code binding} is owned by a parent resolver. If so, calls
* {@link #resolve(DependencyRequest) resolve(request)} on that resolver.
Expand Down