summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-05-10 12:11:43 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-05-10 12:11:43 +0000
commitd7137b0da3d52c459172d16d3b930db2a6efa696 (patch)
tree8448ca290e00e4ffd5932d36d4118ef0e9dc4856
parentaf5db50b1aa2d593c7855f2e8687b0df8cf28453 (diff)
Correctly close the xml writer to flush the stream
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1101420 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
index c7a8a6087e..1fc20867da 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
@@ -32,6 +32,7 @@ import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
import org.apache.tuscany.sca.Node;
import org.apache.tuscany.sca.TuscanyRuntime;
@@ -235,13 +236,14 @@ public class NodeImpl implements Node {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
- compositeProcessor.write(getDomainLevelComposite(), outputFactory.createXMLStreamWriter(bos), new ProcessorContext(extensionPointRegistry));
+ XMLStreamWriter sw = outputFactory.createXMLStreamWriter(bos);
+ compositeProcessor.write(getDomainLevelComposite(), sw, new ProcessorContext(extensionPointRegistry));
+ sw.close();
} catch(Exception e) {
throw new RuntimeException(e);
}
- String result = bos.toString();
- return result;
+ return bos.toString();
}
public Object getQNameDefinition(String contributionURI, QName definition, QName symbolSpace) {
// TODO Auto-generated method stub