camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/2] camel git commit: Optimize type conversion of CxfPaylaod with StreamSource with thanks to Stephan
Date Thu, 09 Apr 2015 08:33:56 GMT
Repository: camel
Updated Branches:
  refs/heads/master cebc80fd4 -> 5d94b2a8f


Optimize type conversion of CxfPaylaod with StreamSource with thanks to Stephan


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ea702338
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ea702338
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ea702338

Branch: refs/heads/master
Commit: ea70233820eb47efa0cda91e95ceb99747dc9b34
Parents: cebc80f
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Thu Apr 9 13:36:20 2015 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Thu Apr 9 16:30:59 2015 +0800

----------------------------------------------------------------------
 .../camel/component/cxf/converter/CxfPayloadConverter.java  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ea702338/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java
index ff24d6c..ac0713e 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/CxfPayloadConverter.java
@@ -182,12 +182,13 @@ public final class CxfPayloadConverter {
                     payload.getBodySources().set(0, new DOMSource(d.getDocumentElement()));
                     return type.cast(d);
                 }
+                // CAMEL-8410 Just make sure we get the Source object directly from the payload
body source
+                Source s = payload.getBodySources().get(0);
+                if (type.isInstance(s)) {
+                    return type.cast(s);
+                }
                 TypeConverter tc = registry.lookup(type, Source.class);
                 if (tc != null) {
-                    Source s = payload.getBodySources().get(0);
-                    if (type.isInstance(s)) {
-                        return type.cast(s);
-                    }
                     if ((s instanceof StreamSource
                         || s instanceof SAXSource) 
                         && !type.isAssignableFrom(Document.class)


Mime
View raw message