[
https://issues.apache.org/jira/browse/SLING-8275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Seifert resolved SLING-8275.
-----------------------------------
Resolution: Fixed
https://github.com/apache/sling-org-apache-sling-caconfig-api/commit/2585dbb9bcf1acce473c42225ce4e28f56b9493a
> ConfigurationBuilder.asValueMap() does not return an empty value map in case
> configuration is not there - clarify JavaDocs
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: SLING-8275
> URL: https://issues.apache.org/jira/browse/SLING-8275
> Project: Sling
> Issue Type: Improvement
> Affects Versions: Context-Aware Configuration API 1.1.2
> Reporter: Konrad Windszus
> Assignee: Stefan Seifert
> Priority: Minor
> Fix For: Context-Aware Configuration API 1.1.4
>
>
> Although the javadoc of
> {{org.apache.sling.caconfig.ConfigurationBuilder.asValueMap(...)}} states
> {quote}Returns:
> Value map. Map is empty if content resource or configuration cannot be
> found.{quote}
> this is in fact not true.
> Instead the value map will contain the default values from the underlying
> annotation value, similar to {{ConfigurationBuilder.as(...)}}. Either the
> javadoc or the implementation needs to be fixed.
> The same is true for
> https://sling.apache.org/apidocs/sling11/org/apache/sling/caconfig/ConfigurationBuilder.html#asAdaptable-java.lang.Class-
> which also applies the default values.
> The collection variants of both methods behave in a similar fashion.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)