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

Sergey Beryozkin commented on CXF-6450:
---------------------------------------

Yes, the variation where an extra interface is interposed does not work (this 
interposition which is what I referred to when talking about the complexity) - 
the test is temp disabled, the case where GenericBookInterface is directly 
implemented works:

http://git-wip-us.apache.org/repos/asf/cxf/commit/748a28aa

Few notes:
- you can create proxies from concrete classes (add cglib nodep)
- the proxy code does not work with GenericBookInterface only because it itself 
has no typed information, hence the test which is still enabled does use 
WebClient + JAXRS2.0 GenericType; (GenericBookServiceInterface is fine though 
for proxies...)

There's indeed a problem with the CXF JAX-RS code introspecting the annotated 
methods which are deeply inherited (more than 1 level) from generic interfaces. 
I'm not sure you'd agree but I think a reasonable workaround can be found. The 
patch looks good but the release is coming very shortly and I'm cautious about 
merging it right now. I'll experiment a bit but most likely it would be merged 
into 3.1.3-SNAPSHOT
 

> Bad handling of JAX-RS generic interfaces
> -----------------------------------------
>
>                 Key: CXF-6450
>                 URL: https://issues.apache.org/jira/browse/CXF-6450
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.0
>            Reporter: Vladimir Kulev
>         Attachments: InjectionUtils.patch
>
>
> Here is a simple example of the code which does *not* work as intended:
> {code:java}
> interface GenericInterface<A> {
>     @GET
>     List<A> list();
> }
> interface ServiceInterface extends GenericInterface<String> {}
> public static class TestService implements ServiceInterface {
>     @Override
>     public List<String> list() {
>         return new ArrayList<>();
>     }
> }
> {code}
> I have found that the shape of {{InjectionUtils}} is pretty bad, so please 
> accept this patch slightly improving the situation.



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

Reply via email to