You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2017/03/06 09:40:33 UTC

[jira] [Commented] (SLING-6609) Fix JSR305 annotations for ValueMap.get

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

Felix Meschberger commented on SLING-6609:
------------------------------------------

Actually, I am not entirely sure, whether @Nonnull is technically entirely correct: The spec says, to return the named property or the {{defaultValue}}. What if the {{defaultValue}} is {{null}} ?

> Fix JSR305 annotations for ValueMap.get
> ---------------------------------------
>
>                 Key: SLING-6609
>                 URL: https://issues.apache.org/jira/browse/SLING-6609
>             Project: Sling
>          Issue Type: Bug
>          Components: API
>    Affects Versions: API 2.16.2
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>             Fix For: API 2.16.4
>
>
> Currently {{<T> T get(@Nonnull String name, T defaultValue);}} does neither define a JSR 305 annotation for the return value nor for the 2nd parameter. It makes sense to define them both as {{@Nonnull}}, because if you intend to get {{null}} as return value you are supposed to take the other get method ({{@CheckForNull <T> T get(@Nonnull String name, @Nonnull Class<T> type)}})



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)