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

Romain Manni-Bucau commented on CXF-5970:
-----------------------------------------

if you take the default ones (shared provider factory) then the order is 
already not respected once sorted.

That said case popped up using jackson json provider. When using it we want it 
first but it is using */* so it is hard to get it right with CXF if any other 
json provider is setup whereever it comes from (scanning or other way).

Runtime must only ensures q=xxx and subclasses first are respected AFAIK. It 
means it is easy to use the list index to compare two providers instead of 
assuming sorting does it in the order and that -1 will be a nice default.

wdyt?

> review org.apache.cxf.jaxrs.provider.ProviderFactory.Message*ReaderComparator
> -----------------------------------------------------------------------------
>
>                 Key: CXF-5970
>                 URL: https://issues.apache.org/jira/browse/CXF-5970
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Romain Manni-Bucau
>
> Actually the task can be rephrase saying rework 
> org.apache.cxf.jaxrs.provider.ProviderFactory#*Comparators
> Current implementations don't seem to have an absolute order which means 
> sorting is not as deterministic as it should be under java >= 7.
> Other point is as a user you set a List of providers (you probably already 
> sorted if important) so you want to ensure *your* order is respected at 
> runtime (ie 
> org.apache.cxf.jaxrs.provider.ProviderFactory#message[Readers|Writers] 
> respect it).
> If you think this sorting is important maybe introducing in 
> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean and 
> org.apache.cxf.jaxrs.provider.ProviderFactory a boolean sortProviders can be 
> enough to prevent calling sortXXX().



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to