[ https://issues.apache.org/jira/browse/SLING-4767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Konrad Windszus updated SLING-4767: ----------------------------------- Fix Version/s: Sling Models Impl 1.2.0 Sling Models API 1.2.0 > Optional sub models are logged as warn if they cannot be adapted > ---------------------------------------------------------------- > > Key: SLING-4767 > URL: https://issues.apache.org/jira/browse/SLING-4767 > Project: Sling > Issue Type: Improvement > Reporter: Georg Henzler > Assignee: Konrad Windszus > Fix For: Sling Models API 1.2.0, Sling Models Impl 1.2.0 > > > Currently Sling Models logs the example model \[1] as warning \[2] if the sub > model image does not exist. This really should be a debug log as it is > totally fine if in optional field cannot be set? > \[1] > {code} > com......mediagallery.MediaGalleryElement > ... > @Inject > @Optional > @Named(value = ".") > private Image image; > {code} > \[2] > org.apache.sling.models.impl.ModelAdapterFactory.injectElement(InjectableElement, > Object, Model, DisposalCallbackRegistry, InjectCallback) > {code} > // log previous injection error, if there was any > if (lastInjectionException != null) { > log.warn("Although falling back to default value worked, > injection into {} failed because of: " + lastInjectionException.getMessage(), > element.getAnnotatedElement(), lastInjectionException); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)