You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2015/04/27 17:42:39 UTC

[jira] [Comment Edited] (CXF-6369) org.apache.cxf.jaxrs.impl.ConfigurationImpl does not comply with SPEC

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

Sergey Beryozkin edited comment on CXF-6369 at 4/27/15 3:41 PM:
----------------------------------------------------------------

I believe I've got a confirmation from a spec lead that the original registration of a given provider class does not get removed.
See a "Registering the same provider class with Configurable" thread at the 370 spec list.

So if you have a test which expect that the same provider class is replaced even if the next registration has a different priority then this test needs to be challenged

Thanks


was (Author: sergey_beryozkin):
I believe I've got a confirmation from a spec lead that only the original registration of a given provider class does not get removed.
See a "Registering the same provider class with Configurable" thread at the 370 spec list.

So if you have a test which expect that the same provider class is replaced even if the next registration has a different priority then this test needs to be challenged

Thanks

> org.apache.cxf.jaxrs.impl.ConfigurationImpl does not comply with SPEC
> ---------------------------------------------------------------------
>
>                 Key: CXF-6369
>                 URL: https://issues.apache.org/jira/browse/CXF-6369
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.3, 3.0.4, 2.7.15
>            Reporter: iris ding
>            Assignee: Sergey Beryozkin
>             Fix For: 3.1.0, 3.0.5
>
>
> According to http://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Configurable.html
> As a general rule, for each JAX-RS component class there can be at most one registration — class-based or instance-based — configured at any given moment. Implementations MUST reject any attempts to configure a new registration for a provider class that has been already registered in the given configurable context earlier. Implementations SHOULD also raise a warning to inform the user about the rejected component registration.
> For example:
>  config.register(GzipInterceptor.class, WriterInterceptor.class);
>  config.register(GzipInterceptor.class);       // Rejected by runtime.
>  config.register(new GzipInterceptor());       // Rejected by runtime.
>  config.register(GzipInterceptor.class, 6500); // Rejected by runtime.
> So we need to check whether the same class's instances have already been put into config before hand.
> Also to check whether the class/instance has been registered via  public boolean isRegistered(Class<?> cls) , we need to check whether the two class is the same other than just isAssignableFrom.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)