You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by iris ding <ir...@gmail.com> on 2015/05/19 15:11:19 UTC

MessageBodyReader and MessageBodyWritter should follow different sorting rule

Hi Guys,

According to JSR-339 spec, section 4.2.1 and 4.2.2, we need follow different
sorting rule for MessageBodyReader and MessageBodyWritter:

For MessageBodyReader, it is:
  
 2. Identify the Java type of the parameter whose value will be mapped from
the entity body. Section 3.7

describes how the Java method is chosen.
   
3. Select the set of MessageBodyReader classes that support the media type
of the request, see Section  4.2.3. 


For MessageBodyWritter, it is:
  
4. Sort the selected MessageBodyWriter providers with a primary key of
generic type where providers whose generic type is the nearest superclass of
the object class are sorted first and a secondary key of media type (see
Section 4.2.3).


But in our implementation, we use the same sorting rule:
 1. compareClasses() ->compareSortedMediaTypes()

This causes an issue in https://issues.apache.org/jira/browse/CXF-6380.
We can get this fixed to adjust the MessageBodyReader sorting rule.  I have
opened an JIRA: https://issues.apache.org/jira/browse/CXF-6412 and provide a
fix for this probllem. Can you help review it and give your comments?

Thanks & Best Regards,

Iris Ding



--
View this message in context: http://cxf.547215.n5.nabble.com/MessageBodyReader-and-MessageBodyWritter-should-follow-different-sorting-rule-tp5757415.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: MessageBodyReader and MessageBodyWritter should follow different sorting rule

Posted by iris ding <ir...@gmail.com>.
Thanks Sergey, I confirmed in lastes CXF code, this has arleady been fixed.



--
View this message in context: http://cxf.547215.n5.nabble.com/MessageBodyReader-and-MessageBodyWritter-should-follow-different-sorting-rule-tp5757415p5757483.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: MessageBodyReader and MessageBodyWritter should follow different sorting rule

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

I think I resolved it as part some different issue, please check the 
latest source in 3.0.6-SNAPSHOT and let me know
Thanks, Sergey
On 19/05/15 14:11, iris ding wrote:
> Hi Guys,
>
> According to JSR-339 spec, section 4.2.1 and 4.2.2, we need follow different
> sorting rule for MessageBodyReader and MessageBodyWritter:
>
> For MessageBodyReader, it is:
>
>   2. Identify the Java type of the parameter whose value will be mapped from
> the entity body. Section 3.7
>
> describes how the Java method is chosen.
>
> 3. Select the set of MessageBodyReader classes that support the media type
> of the request, see Section  4.2.3.
>
>
> For MessageBodyWritter, it is:
>
> 4. Sort the selected MessageBodyWriter providers with a primary key of
> generic type where providers whose generic type is the nearest superclass of
> the object class are sorted first and a secondary key of media type (see
> Section 4.2.3).
>
>
> But in our implementation, we use the same sorting rule:
>   1. compareClasses() ->compareSortedMediaTypes()
>
> This causes an issue in https://issues.apache.org/jira/browse/CXF-6380.
> We can get this fixed to adjust the MessageBodyReader sorting rule.  I have
> opened an JIRA: https://issues.apache.org/jira/browse/CXF-6412 and provide a
> fix for this probllem. Can you help review it and give your comments?
>
> Thanks & Best Regards,
>
> Iris Ding
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/MessageBodyReader-and-MessageBodyWritter-should-follow-different-sorting-rule-tp5757415.html
> Sent from the cxf-dev mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com