cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] [Commented] (CXF-6369) org.apache.cxf.jaxrs.impl.ConfigurationImpl does not comply with SPEC
Date Fri, 24 Apr 2015 11:18:39 GMT


Sergey Beryozkin commented on CXF-6369:

The change to isRegistered is fine, but I'm not sure about the 2nd one, I think it is sufficient
to check if a given provider has already been registered and if yes then issue a warning as
per the Java docs and return

> org.apache.cxf.jaxrs.impl.ConfigurationImpl does not comply with SPEC
> ---------------------------------------------------------------------
>                 Key: CXF-6369
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.3, 3.0.4, 2.7.15
>            Reporter: iris ding
> According to
> 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

View raw message