justinedelson commented on a change in pull request #17:
URL:
https://github.com/apache/sling-org-apache-sling-models-impl/pull/17#discussion_r443608867
##########
File path: src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
##########
@@ -495,12 +480,97 @@ public RuntimeException inject(InjectableElement element,
Object value) {
}
}
+ @NotNull
+ private InjectableElement getElement(InjectableElement element, Type type)
{
Review comment:
IIUC, this method is not named intuitively. It should be something like
`getOptionalTypeElement` or something like that.
It also might be best to move this logic to the constructor of
`InjectableField` or at least move this anonymous inner class to a new class
named `OptionalTypedInjectableField` (or something like that since `Optional`
is now a bit ambiguous).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]