[
https://issues.apache.org/jira/browse/SLING-8275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konrad Windszus updated SLING-8275:
-----------------------------------
Description:
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.
was:
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.
> ConfigurationBuilder.asValueMap() does not return an empty value map in case
> configuration is not there
> -------------------------------------------------------------------------------------------------------
>
> Key: SLING-8275
> URL: https://issues.apache.org/jira/browse/SLING-8275
> Project: Sling
> Issue Type: Bug
> Affects Versions: Context-Aware Configuration API 1.1.2, Context-Aware
> Configuration Impl 1.4.14
> Reporter: Konrad Windszus
> Priority: Major
>
> 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)