Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C10329A4E for ; Mon, 13 Aug 2012 03:40:16 +0000 (UTC) Received: (qmail 12683 invoked by uid 500); 13 Aug 2012 03:40:16 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 12598 invoked by uid 500); 13 Aug 2012 03:40:15 -0000 Mailing-List: contact commits-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 commits@camel.apache.org Received: (qmail 12568 invoked by uid 99); 13 Aug 2012 03:40:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Aug 2012 03:40:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Aug 2012 03:40:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2492D23888FE; Mon, 13 Aug 2012 03:39:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1372254 - in /camel/branches/camel-2.9.x: ./ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/ components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ Date: Mon, 13 Aug 2012 03:39:26 -0000 To: commits@camel.apache.org From: ningjiang@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120813033927.2492D23888FE@eris.apache.org> Author: ningjiang Date: Mon Aug 13 03:39:26 2012 New Revision: 1372254 URL: http://svn.apache.org/viewvc?rev=1372254&view=rev Log: Merged revisions 1372249 via svnmerge from https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x ........ r1372249 | ningjiang | 2012-08-13 11:11:52 +0800 (Mon, 13 Aug 2012) | 2 lines CAMEL-5499 Fixed the Cxf fallback converter issue of return null instead of Void.value ........ Modified: camel/branches/camel-2.9.x/ (props changed) camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Merged /camel/trunk:r1371967,1372244-1372245 Merged /camel/branches/camel-2.10.x:r1372249 Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java?rev=1372254&r1=1372253&r2=1372254&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java (original) +++ camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfConverter.java Mon Aug 13 03:39:26 2012 @@ -153,7 +153,8 @@ public final class CxfConverter { // CXF-WS MessageContentsList class if (MessageContentsList.class.isAssignableFrom(value.getClass())) { MessageContentsList list = (MessageContentsList)value; - + + // try to turn the first array element into the object that we want for (Object embedded : list) { if (embedded != null) { if (type.isInstance(embedded)) { @@ -161,7 +162,12 @@ public final class CxfConverter { } else { TypeConverter tc = registry.lookup(type, embedded.getClass()); if (tc != null) { - return tc.convertTo(type, exchange, embedded); + Object result = tc.convertTo(type, exchange, embedded); + if (result != null) { + return (T)result; + } + // there is no suitable result will be return + break; } } } Modified: camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java?rev=1372254&r1=1372253&r2=1372254&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java (original) +++ camel/branches/camel-2.9.x/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java Mon Aug 13 03:39:26 2012 @@ -169,8 +169,15 @@ public final class CxfPayloadConverter { } } TypeConverter tc = registry.lookup(type, NodeList.class); - if (tc != null) { - return tc.convertTo(type, cxfPayloadToNodeList((CxfPayload) value, exchange)); + if (tc != null) { + Object result = tc.convertTo(type, cxfPayloadToNodeList((CxfPayload) value, exchange)); + if (result == null) { + // no we could not do it currently, and we just abort the convert here + return (T) Void.TYPE; + } else { + return (T) result; + } + } // we cannot convert a node list, so we try the first item from the // node list Modified: camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java?rev=1372254&r1=1372253&r2=1372254&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java (original) +++ camel/branches/camel-2.9.x/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerProviderTest.java Mon Aug 13 03:39:26 2012 @@ -59,7 +59,6 @@ public class CxfConsumerProviderTest ext from(getFromEndpointUri()).process(new Processor() { public void process(final Exchange exchange) { Message in = exchange.getIn(); - // Get the parameter list Node node = in.getBody(Node.class); assertNotNull(node); XmlConverter xmlConverter = new XmlConverter(); @@ -80,7 +79,7 @@ public class CxfConsumerProviderTest ext assertTrue("Get a wrong response ", response.startsWith(RESPONSE_MESSAGE_BEGINE)); assertTrue("Get a wrong response ", response.endsWith(RESPONSE_MESSAGE_END)); try { - response = template.requestBody(simpleEndpointAddress, null, String.class); + template.requestBody(simpleEndpointAddress, null, String.class); fail("Excpetion to get exception here"); } catch (Exception ex) { // do nothing here