[ 
https://issues.apache.org/jira/browse/WINK-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730037#action_12730037
 ] 

Hudson commented on WINK-49:
----------------------------

Integrated in Wink-Trunk-JDK15 #20 (See 
[http://hudson.zones.apache.org/hudson/job/Wink-Trunk-JDK15/20/])
    Fix for Annotations[] null on error path

See []


> Annotations[] is null when searchResult is empty (i.e. when on error path)
> --------------------------------------------------------------------------
>
>                 Key: WINK-49
>                 URL: https://issues.apache.org/jira/browse/WINK-49
>             Project: Wink
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 0.1
>            Reporter: Bryant Luk
>            Assignee: Bryant Luk
>            Priority: Minor
>             Fix For: 0.1
>
>
> In wink-server FlushResultHandler,
>         Type genericType = null;
>         Annotation[] declaredAnnotations = null;
>         SearchResult searchResult = context.getAttribute(SearchResult.class);
>         if (searchResult != null && searchResult.isFound()) {
>             Method reflectionMethod = 
> searchResult.getMethod().getMetadata().getReflectionMethod();
>             genericType = reflectionMethod.getGenericReturnType();
>             declaredAnnotations = reflectionMethod.getDeclaredAnnotations();
>         }
> If we're on the error path, declaredAnnotations will remain null.  It is 
> debatable if declaredAnnotations should be:
> Annotation[] declaredAnnotations = new Annotation[0];
> instead.  I think some writer provider code would be like:
> boolean isWriteable(java.lang.Class<?> type,
>                     java.lang.reflect.Type genericType,
>                     java.lang.annotation.Annotation[] annotations,
>                     MediaType mediaType) {
>    ... some type checking ...
>    for(Annotation a : annotations) {
>     /* do something here */
>    }
> }
> which would cause a NPE on the error pass if the type matched.  Edge error 
> case and doesn't block 0.1.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to