cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6388) NPE has been swallowed in org.apache.cxf.jaxrs.impl.AsyncResponseImpl
Date Mon, 04 May 2015 21:08:07 GMT

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

Sergey Beryozkin commented on CXF-6388:
---------------------------------------

Thanks for the patch

> NPE has been swallowed in org.apache.cxf.jaxrs.impl.AsyncResponseImpl
> ---------------------------------------------------------------------
>
>                 Key: CXF-6388
>                 URL: https://issues.apache.org/jira/browse/CXF-6388
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.3, 3.0.4, 2.7.15
>            Reporter: iris ding
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>             Fix For: 3.1.1, 3.0.6
>
>
> According to https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/container/AsyncResponse.html#register(java.lang.Class):
> we need throw NullPointerException - in case the callback class is null in all register
method. 
> However, CXF swallows the NPE.
> The proposed fix is to throw NPE in below method:
> public Map<Class<?>, Collection<Class<?>>> register(Class<?>
callback, Class<?>... callbacks)
>                     throws NullPointerException {
>         try {
>             Object[] extraCallbacks = new Object[callbacks.length];
>             for (int i = 0; i < callbacks.length; i++) {
>                 extraCallbacks[i] = callbacks[i].newInstance();
>             }
>             return register(callback.newInstance(), extraCallbacks);
>         }
>      //proposed change start
>       catch (NullPointerException e)
>         {
>             throw e;
>         } 
>     //proposed change end
>      catch (Throwable t) {
>             return Collections.emptyMap();
>         }
>     }
> After this, my CTS passed!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message