[
https://issues.apache.org/jira/browse/CXF-5970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14112105#comment-14112105
]
Sergey Beryozkin commented on CXF-5970:
---------------------------------------
Hi,
I need to have a scenario where sorting causes the spec compliance issues. So
far I understand that ProviderFactory does not cause the side-effects by
sorting the providers. I'd say if the sorting were causing the issues then it
would be a sorting comparator bug as opposed to the sorting itself. See, if we
have say "application/json" and "*/*" providers, then clearly a provider with
"application/json" has to be asked first if it supports reading/writing a given
type. If we have MyProvider and OtherProvider<Foo> then again
OtherProvider<Foo> should be given a chance first before MyProvider gets Foo
and then rejects it. So disabling the sorting would likely cause side-effects
as opposed to improvements. And we also have confirmed the order of the
providers with the same properties does not get changed.
Lets fix it with a Later tag then, will be happy to review the issue if we
identify a concrete issue with the sorting :-).
Thanks
> 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
> Assignee: Sergey Beryozkin
>
> 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)