Repository: camel Updated Branches: refs/heads/camel-2.17.x ef0d58271 -> cee716bc6
CAMEL-10111: Creating an InputStream from XMLStreamReader fails with ASCII default platform encoding Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cee716bc Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cee716bc Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cee716bc Branch: refs/heads/camel-2.17.x Commit: cee716bc69a3384a83b2f3079e8f6aec267f3d56 Parents: ef0d582 Author: Stephan Siano <stephan.si...@sap.com> Authored: Fri Jul 1 10:56:34 2016 +0200 Committer: Stephan Siano <stephan.si...@sap.com> Committed: Fri Jul 1 12:03:15 2016 +0200 ---------------------------------------------------------------------- .../camel/converter/jaxp/XMLStreamReaderInputStream.java | 2 +- .../camel/component/cxf/converter/CxfPayloadConverter.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/cee716bc/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java b/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java index 96783d4..ab8de5c 100644 --- a/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java +++ b/camel-core/src/main/java/org/apache/camel/converter/jaxp/XMLStreamReaderInputStream.java @@ -45,7 +45,7 @@ class XMLStreamReaderInputStream extends InputStream { this.chunk = new TrimmableByteArrayOutputStream(); this.charset = charset == null ? "utf-8" : charset; try { - this.writer = outfactory.createXMLStreamWriter(chunk, charset); + this.writer = outfactory.createXMLStreamWriter(chunk, this.charset); } catch (XMLStreamException e) { //ignore } http://git-wip-us.apache.org/repos/asf/camel/blob/cee716bc/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 196dbce..1da3fff 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 @@ -202,7 +202,7 @@ public final class CxfPayloadConverter { if (payload.getNsMap() != null) { r = new DelegatingXMLStreamReader(r, payload.getNsMap()); } - return (T)tc.convertTo(type, r); + return (T)tc.convertTo(type, exchange, r); } tc = registry.lookup(type, Source.class); if (tc != null) { @@ -217,12 +217,12 @@ public final class CxfPayloadConverter { s = new StAXSource(new DelegatingXMLStreamReader(r, payload.getNsMap())); } } - return (T)tc.convertTo(type, s); + return (T)tc.convertTo(type, exchange, s); } } TypeConverter tc = registry.lookup(type, NodeList.class); if (tc != null) { - Object result = tc.convertTo(type, cxfPayloadToNodeList((CxfPayload<?>) value, exchange)); + Object result = tc.convertTo(type, exchange, 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; @@ -237,7 +237,7 @@ public final class CxfPayloadConverter { if (tc != null) { NodeList nodeList = cxfPayloadToNodeList((CxfPayload<?>) value, exchange); if (nodeList.getLength() > 0) { - return tc.convertTo(type, nodeList.item(0)); + return tc.convertTo(type, exchange, nodeList.item(0)); } else { // no we could not do it currently return (T) Void.TYPE;