[
https://issues.apache.org/jira/browse/SLING-9774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Radu Cotescu closed SLING-9774.
-------------------------------
> The ValueMapUtil#merge behavior is different from the deprecated
> CompositeValueMap
> ----------------------------------------------------------------------------------
>
> Key: SLING-9774
> URL: https://issues.apache.org/jira/browse/SLING-9774
> Project: Sling
> Issue Type: Bug
> Affects Versions: API 2.23.0
> Reporter: Eric Norman
> Assignee: Eric Norman
> Priority: Major
> Fix For: API 2.23.4
>
>
> CompositeValueMap has been marked as deprecated and the recommendation was to
> replace those usages with ValueMapUtil#merge(ValueMap...)}
> Unfortunately it looks like implementation from ValueMapUtil#merge has
> different behavior when it comes to handling of entries in the map where the
> key is supplied but the value is null.
> My use case is that in a few places I have used the key=null behavior of
> CompositeValueMap to hide entries in a wrapped ValueMap and those uses cases
> don't work the same after switching to ValueMapUtil#merge(ValueMap...)}.
> To be compatible with the deprecated CompositeValueMap, the
> MergingValueMap#get impl should not automatically filter entries whose value
> is null. Instead it should only filter when the value is null and the map
> does not contain the key. A null value doesn't always mean that the map
> didn't have an entry for the key.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)