ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r549253 - in /incubator/ode/trunk: bpel-obj/src/main/java/org/apache/ode/bpel/o/OAssign.java bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
Date Wed, 20 Jun 2007 21:42:45 GMT
Author: mriou
Date: Wed Jun 20 14:42:44 2007
New Revision: 549253

URL: http://svn.apache.org/viewvc?view=rev&rev=549253
Log:
Sharing an assigned literal across all instances without copying it before manipulation is
a bad idea. Several operations that we do on it afterward aren't thread safe.

Modified:
    incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OAssign.java
    incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java

Modified: incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OAssign.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OAssign.java?view=diff&rev=549253&r1=549252&r2=549253
==============================================================================
--- incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OAssign.java (original)
+++ incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OAssign.java Wed Jun
20 14:42:44 2007
@@ -21,13 +21,14 @@
 import org.apache.ode.bpel.o.OScope.Variable;
 import org.apache.ode.utils.DOMUtils;
 import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
 
+import javax.xml.namespace.QName;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.xml.namespace.QName;
-
 public class OAssign extends OActivity {
     static final long serialVersionUID = -1L  ;
     
@@ -103,6 +104,13 @@
             }
         }
 
+        public Document getXmlLiteral() {
+            Element literalRoot = xmlLiteral.getDocumentElement();
+            Document copyDoc = DOMUtils.newDocument();
+            Node copyElmt = copyDoc.importNode(literalRoot, true);
+            copyDoc.appendChild(copyElmt);
+            return copyDoc;
+        }
     }
 
     public static class LValueExpression extends OBase implements LValue {

Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java?view=diff&rev=549253&r1=549252&r2=549253
==============================================================================
--- incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
(original)
+++ incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
Wed Jun 20 14:42:44 2007
@@ -220,8 +220,7 @@
             }
             retVal = (Node) l.get(0);
         } else if (from instanceof OAssign.Literal) {
-            Element literalRoot = ((OAssign.Literal) from).xmlLiteral
-                    .getDocumentElement();
+            Element literalRoot = ((OAssign.Literal) from).getXmlLiteral().getDocumentElement();
             assert literalRoot.getLocalName().equals("literal");
             // We'd like a single text node...
 



Mime
View raw message