Skip to content

Commit

Permalink
ISSUES-17 allow sibling binding
Browse files Browse the repository at this point in the history
  • Loading branch information
h908714124 committed Dec 3, 2023
1 parent 8e59e4a commit 837587d
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@ private Map<Key, InjectBinding> injectBindingsMiss(TypeElement typeElement) {
}

public Optional<Binding> binding(Key key) {
return tool.types().asElement(key.type()).flatMap(element -> {
TypeElement typeElement = TYPE_ELEMENT_VISITOR.visit(element);
if (typeElement == null) {
return Optional.empty();
}
Map<Key, InjectBinding> m = injectBindings(typeElement);
return Optional.ofNullable(m.get(key));
});
return tool.types().asElement(key.type())
.map(TYPE_ELEMENT_VISITOR::visit)
.flatMap(typeElement -> {
Map<Key, InjectBinding> m = injectBindings(typeElement);
return Optional.ofNullable(m.get(key));
});
}

@Override
Expand Down

0 comments on commit 837587d

Please sign in to comment.