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 C1A4BD479 for ; Tue, 18 Dec 2012 08:48:08 +0000 (UTC) Received: (qmail 84360 invoked by uid 500); 18 Dec 2012 08:48:08 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 84259 invoked by uid 500); 18 Dec 2012 08:48:05 -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 84212 invoked by uid 99); 18 Dec 2012 08:48:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Dec 2012 08:48:03 +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; Tue, 18 Dec 2012 08:48:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EE6C52388C2D; Tue, 18 Dec 2012 08:47:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1423340 - in /camel/branches/camel-2.9.x: ./ components/camel-http/src/main/java/org/apache/camel/component/http/ components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ tests/camel-itest/src/test/java/org/apache/camel/itest/j... Date: Tue, 18 Dec 2012 08:47:41 -0000 To: commits@camel.apache.org From: ningjiang@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121218084741.EE6C52388C2D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ningjiang Date: Tue Dec 18 08:47:39 2012 New Revision: 1423340 URL: http://svn.apache.org/viewvc?rev=1423340&view=rev Log: CAMEL-5890 fixed the NPE when jaxb fallbackConverter is used with RequestEntityConverter Merged revisions 1423309 via svnmerge from https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x ................ r1423309 | ningjiang | 2012-12-18 16:04:30 +0800 (Tue, 18 Dec 2012) | 14 lines Merged revisions 1423299,1423304 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk ........ r1423299 | ningjiang | 2012-12-18 15:06:50 +0800 (Tue, 18 Dec 2012) | 1 line CAMEL-5890 fixed the NPE when jaxb fallbackConverter is used with RequestEntityConverter ........ r1423304 | ningjiang | 2012-12-18 15:41:58 +0800 (Tue, 18 Dec 2012) | 1 line CAMEL-5890 Fixed the CS error of JaxbFallbackTypeConverterTest ........ ................ Added: camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jaxb/JaxbFallbackTypeConverterTest.java - copied unchanged from r1423309, camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jaxb/JaxbFallbackTypeConverterTest.java camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jaxb/example/ - copied from r1423309, camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jaxb/example/ camel/branches/camel-2.9.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jaxb/example/Bar.java - copied unchanged from r1423309, camel/branches/camel-2.10.x/tests/camel-itest/src/test/java/org/apache/camel/itest/jaxb/example/Bar.java Modified: camel/branches/camel-2.9.x/ (props changed) camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/RequestEntityConverter.java camel/branches/camel-2.9.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Merged /camel/trunk:r1423299,1423304 Merged /camel/branches/camel-2.10.x:r1423309 Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/RequestEntityConverter.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/RequestEntityConverter.java?rev=1423340&r1=1423339&r2=1423340&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/RequestEntityConverter.java (original) +++ camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/RequestEntityConverter.java Tue Dec 18 08:47:39 2012 @@ -48,7 +48,7 @@ public final class RequestEntityConverte @Converter public static RequestEntity toRequestEntity(String str, Exchange exchange) throws Exception { - if (GZIPHelper.isGzip(exchange.getIn())) { + if (exchange != null && GZIPHelper.isGzip(exchange.getIn())) { byte[] data = exchange.getContext().getTypeConverter().convertTo(byte[].class, str); return asRequestEntity(data, exchange); } else { Modified: camel/branches/camel-2.9.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java?rev=1423340&r1=1423339&r2=1423340&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java (original) +++ camel/branches/camel-2.9.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java Tue Dec 18 08:47:39 2012 @@ -219,7 +219,8 @@ public class FallbackTypeConverter exten } else { marshaller.marshal(value, buffer); } - answer = parentTypeConverter.convertTo(type, buffer.toString()); + // we need to pass the exchange + answer = parentTypeConverter.convertTo(type, exchange, buffer.toString()); } return answer;