@Override public void visitGraph(BindingGraph graph, DiagnosticReporter diagnosticReporter) { if (graph.isModuleBindingGraph() || graph.isPartialBindingGraph()) { return; // Don't report missing bindings when validating a module or a partial binding graph } graph .missingBindings() .forEach(missingBinding -> reportMissingBinding(missingBinding, graph, diagnosticReporter)); }
@Override public void visitGraph(BindingGraph bindingGraph, DiagnosticReporter diagnosticReporter) { if (bindingGraph.isModuleBindingGraph() || bindingGraph.isPartialBindingGraph()) { // We don't know all the modules that might be owned by the child until we know the root. return; } bindingGraph.network().edges().stream() .flatMap(instancesOf(ChildFactoryMethodEdge.class)) .forEach( edge -> { ImmutableSet<TypeElement> missingModules = findMissingModules(edge, bindingGraph); if (!missingModules.isEmpty()) { reportMissingModuleParameters( edge, missingModules, bindingGraph, diagnosticReporter); } }); }
new StringBuilder(componentNode.componentPath().currentComponent().getQualifiedName()); if (bindingGraph.isModuleBindingGraph() && componentNode.componentPath().atRoot()) {
if (bindingGraph.isModuleBindingGraph()) { diagnosticReporter.reportComponent( ERROR,
@Override public void visitGraph(BindingGraph bindingGraph, DiagnosticReporter diagnosticReporter) { ImmutableSetMultimap.Builder<ComponentNode, dagger.model.Binding> incompatibleBindings = ImmutableSetMultimap.builder(); for (dagger.model.Binding binding : bindingGraph.bindings()) { binding .scope() .filter(scope -> !scope.isReusable()) .ifPresent( scope -> { ComponentNode componentNode = bindingGraph.componentNode(binding.componentPath()).get(); if (!componentNode.scopes().contains(scope)) { // @Inject bindings in module binding graphs will appear at the properly scoped // ancestor component, so ignore them here. if (binding.kind().equals(INJECTION) && bindingGraph.isModuleBindingGraph()) { return; } incompatibleBindings.put(componentNode, binding); } }); } Multimaps.asMap(incompatibleBindings.build()) .forEach( (componentNode, bindings) -> report(componentNode, bindings, bindingGraph, diagnosticReporter)); }