Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 06FFE2928 for ; Thu, 21 Apr 2011 17:04:45 +0000 (UTC) Received: (qmail 73064 invoked by uid 500); 21 Apr 2011 17:04:44 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 73036 invoked by uid 500); 21 Apr 2011 17:04:44 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 73027 invoked by uid 99); 21 Apr 2011 17:04:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Apr 2011 17:04:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Apr 2011 17:04:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B3002ACC1A for ; Thu, 21 Apr 2011 17:04:05 +0000 (UTC) Date: Thu, 21 Apr 2011 17:04:05 +0000 (UTC) From: "Daniel Kulp (JIRA)" To: dev@camel.apache.org Message-ID: <1792439189.73831.1303405445714.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (CAMEL-3889) ProxyHelper and ProxyBuilder methods generate warnings and are pretty much unusable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 ProxyHelper and ProxyBuilder methods generate warnings and are pretty much unusable ----------------------------------------------------------------------------------- Key: CAMEL-3889 URL: https://issues.apache.org/jira/browse/CAMEL-3889 Project: Camel Issue Type: Improvement Components: camel-core Reporter: Daniel Kulp The ProxyHelper/Builder methods that look like: T createProxy(Endpoint endpoint, Class... 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 createProxy(Endpoint endpoint, Class... interfaceClasses) Very simple, it works. No warnings. 2) Add a method like: T createProxy(Endpoint endpoint, Class interfaceClass) to really handle the single interface case (which is all of the cases in Camel) and @Deprecate the broken version. 3) T createProxy(Endpoint endpoint, Class 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: http://www.atlassian.com/software/jira