You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2018/04/17 22:43:00 UTC

[jira] [Commented] (CXF-7713) CLONE - JAXRS CTS/TCK issue: register(...) should ignore components when invalid contracts are passed in

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

Mark Struberg commented on CXF-7713:
------------------------------------

The original fix of CXF-7638 does indeed break some older functionality.
 The new code does not check for nested interfaces.

Given the code:
{code:java}
public interface MyClientFilter extends ClientRequestFilter {
 ...
}

public class MyClientFilterImpl implements MyClientFilter {
...
}
{code}
This situation currently doesn't get detected as ClientRequestFilter.
The client.register() call simply gets ignored more or less.

This is pretty easy solvable via a recursive call.

I gonna provide a patch tomorrow.

> CLONE - JAXRS CTS/TCK issue:  register(...) should ignore components when invalid contracts are passed in
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-7713
>                 URL: https://issues.apache.org/jira/browse/CXF-7713
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.2.2
>            Reporter: Mark Struberg
>            Assignee: Andy McCright
>            Priority: Major
>             Fix For: 3.2.3, 3.2.4
>
>
> We're seeing some failures when running the JAX-RS 2.1 TCK - particularly around the register method. The javadoc states that the implementation MUST ignore the component if the call to register specifies a contract (interface) that the component does not implement.
> So, for example, suppose somebody calls code like this:
>  
> public class MyProvider implements MessageBodyWriter<MyObject> ...
>  
> Client c = ClientBuilder.newClient();
> c.register(MyProvider.class, ContainerRequestFilter.class); // should ignore
> c.register(new MyProvider, ExceptionMapper.class, MessageBodyReader.class); // should ignore
> Map<Class, int> contractPriorityMap = new HashMap<>();
> contractPriorityMap.put(ClientResponseFilter.class, 20);
> c.register(MyProvider.class, contractPriorityMap); // should ignore
> c.register(new MyProvider.class, contractPriorityMap); // should ignore
>  
> The TCK tests basically check that nothing gets registered when a passed-in contract is not assignable to the provider class.  And scenarios like the four mentioned above are failing.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)