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

Michael Bolz commented on OLINGO-3:
-----------------------------------

Hi,

thanks for your patch.

IMHO it is a best/common practice to return empty lists/collections instead of 
{{NULL}}.
But if it will change with a further version of JAX-RS it would be good to be 
fault safe and add the "not {{NULL}} check" as Aki suggests.

Kind regards,
Michael
                
> NPE guard for missing Accept headers
> ------------------------------------
>
>                 Key: OLINGO-3
>                 URL: https://issues.apache.org/jira/browse/OLINGO-3
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>         Environment: 1.0.0-SNAPSHOT
>            Reporter: Aki Yoshida
>            Priority: Minor
>             Fix For: 1.0.0
>
>         Attachments: odata-core-20130814.patch
>
>
> org.apache.olingo.odata2.core.rest.RestUtil's extractAcceptHeaders is not 
> guarding against an NPE for the missing accept headers. 
> cxf-2.7.x currently returns an empty list in this case, therefore it does not 
> lead to an issue. However, the correct behavior is to return a null in this 
> case.
> https://java.net/jira/browse/JAX_RS_SPEC-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=359530#action_359530
> Therefore, the above method should guard against an NPE for the acceptHeaders 
> variable being null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to