[ 
https://issues.apache.org/jira/browse/SLING-3887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14116186#comment-14116186
 ] 

Alexander Klimetschek commented on SLING-3887:
----------------------------------------------

Agree to both points:
* un-deprecate it: the null handling case is very useful in application code
* the empty map does not need to be modifiable, it should just nicely return 
nothing for get() calls

> API: Un-deprecate ResourceUtil.getValueMap method
> -------------------------------------------------
>
>                 Key: SLING-3887
>                 URL: https://issues.apache.org/jira/browse/SLING-3887
>             Project: Sling
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: API 2.8.0
>            Reporter: Stefan Seifert
>            Priority: Trivial
>             Fix For: API 2.8.2
>
>         Attachments: 140827_SLING-3887_getValueMap.patch
>
>
> the method {{ResourceUtil.getValueMap(<Resource>)}} is deprecated since rev. 
> 1577527 (in context of SLING-3453/SLING-3451) referring to 
> {{Resource.getValueMap()}}.
> but these two methods are not fully equivalent from a convenience 
> perspective: {{ResourceUtil.getValueMap}} supports returning an empty map if 
> the resource is null, while for the {{Resource.getValueMap()}} an explicit 
> null check and returning an empty map has to be implemented by the caller, 
> which is too much boilerplate code.
> the simplest solution would be to just undeprecate it. patch attached.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to