camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadrian Zbarcea (JIRA)" <>
Subject [jira] [Assigned] (CAMEL-3889) ProxyHelper and ProxyBuilder methods generate warnings and are pretty much unusable
Date Thu, 21 Apr 2011 18:40:05 GMT


Hadrian Zbarcea reassigned CAMEL-3889:

    Assignee: Hadrian Zbarcea

> ProxyHelper and ProxyBuilder methods generate warnings and are pretty much unusable
> -----------------------------------------------------------------------------------
>                 Key: CAMEL-3889
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Daniel Kulp
>            Assignee: Hadrian Zbarcea
>         Attachments: patch1.txt, patch2.txt, patch3.txt
> The ProxyHelper/Builder methods that look like:
> <T> T createProxy(Endpoint endpoint, Class<T>... interfaceClasses)
> will generate a compile warning whenever you try to use them.   Part of the reason is
that they are completely broken when written that way.   The intention is to be able to specify
multiple interface classes.  However, you cannot with the above signature  as you can ONLY
pass the T.class.     Thus, something like createProxy(ep, Foo.class, Foo.class) will work
(but is useless), but something like createProxy(ep, Foo.class, Bar.class) will not, even
if Bar extends Foo.    THUS, the way it's written, you can really only effectively pass in
a single interfaceClass and have it work.
> There are three alternatives (I'll attach patches for all three for consideration) (all
three would require javadoc updates, let me know which alternative is preferred and I'll happily
provide the javadoc updates):
> 1) Change to:   <T> T createProxy(Endpoint endpoint, Class<?>... interfaceClasses)
> Very simple, it works.   No warnings.  
> 2) Add a method like:   <T> T createProxy(Endpoint endpoint, Class<T> interfaceClass)
> to really handle the single interface case (which is all of the cases in Camel) and @Deprecate
the broken version.
> 3) <T> T createProxy(Endpoint endpoint, Class<T> interfaceClass, Class<?>
... otherInterfaces)
> to separate out the "primary" interface and the "extras".
> I personally prefer either 1 or 2, leaning toward #2.  Maybe move to #1 for 3.0.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message