tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1101420 - /tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
Date Tue, 10 May 2011 12:11:43 GMT
Author: antelder
Date: Tue May 10 12:11:43 2011
New Revision: 1101420

URL: http://svn.apache.org/viewvc?rev=1101420&view=rev
Log:
Correctly close the xml writer to flush the stream

Modified:
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java?rev=1101420&r1=1101419&r2=1101420&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
Tue May 10 12:11:43 2011
@@ -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



Mime
View raw message