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

Bryant Luk commented on WINK-53:
--------------------------------

(If this reposts, sorry.  JIRA didn't think I was logged in so I lost my 
original comment).

In essence, I think I understand what you're saying.  Honestly, I didn't think 
about moving up the hierarchy.  However, beyond the Source built-in providers, 
what type are you expecting to support above (i.e. is it only Object)?  I would 
hope that no one is expecting an Object entity parameter to be useful since 
every JAX-RS implementation could implement this very differently and who knows 
what gets injected (i.e. String, Source, etc.)

I think we should be careful about supporting things up the hierarchy and/or 
supporting Object entity parameter injection.  This can "wildly" change 
behavior depending on providers moving around, media types being added, etc.

Taking the Source provider as an example, I would also be harder pressed to 
change the StreamSource that is returned for a plain Source entity parameter to 
a a different Source type after we do a release unless there's a strong reason 
to do so.  Just throwing this out there (which I'm fairly certain everyone 
already knows), but some developers expect certain behavior/performance 
characteristics after a release to stay constant even though the runtime should 
have the flexibility to do things differently.

My recommendation to them is of course, to write their own application provided 
Provider (which is one of the things I like about JAX-RS in that we supposedly 
always get out of your way) but not everyone will be "happy" about that. :)

> MessageBodyReader.isReadable methods should do straight ==
> ----------------------------------------------------------
>
>                 Key: WINK-53
>                 URL: https://issues.apache.org/jira/browse/WINK-53
>             Project: Wink
>          Issue Type: Bug
>          Components: Common
>    Affects Versions: 0.1
>            Reporter: Bryant Luk
>            Assignee: Bryant Luk
>            Priority: Minor
>             Fix For: 0.1
>
>         Attachments: WINK-53.patch
>
>
> In some cases the built in MessageBodyReaders providers's isReadable method 
> does an isAssignableFrom.  This should just be a straight == instead.
> For instance in InputStreamProvider:
>      public boolean isReadable(Class<?> type, Type genericType, Annotation[] 
> ann
>          MediaType mediaType) {
> -        return type != null && InputStream.class.isAssignableFrom(type);
> +        return type != null && InputStream.class == type;
>      }
> If the method parameter were:
> @GET
> public void getMethod(FileInputStream fis) {
> }
> we get a 500 back (because I think the injection throws) instead of a 415.  I 
> can fix this up.

-- 
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