You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/10/01 18:42:21 UTC

svn commit: r700830 - in /ode/sandbox/simpel: ./ lib/ src/main/java/org/apache/ode/simpel/ src/main/java/org/apache/ode/simpel/expr/ src/main/java/org/apache/ode/simpel/omodel/

Author: mriou
Date: Wed Oct  1 09:42:21 2008
New Revision: 700830

URL: http://svn.apache.org/viewvc?rev=700830&view=rev
Log:
A few bug fixes, result from having processes compiled that do not execute for tests.

Modified:
    ode/sandbox/simpel/Rakefile
    ode/sandbox/simpel/lib/rhino-1.7R2pre-patched.jar
    ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/SimPELCompiler.java
    ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/expr/E4XExprRuntime.java
    ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/omodel/OBuilder.java

Modified: ode/sandbox/simpel/Rakefile
URL: http://svn.apache.org/viewvc/ode/sandbox/simpel/Rakefile?rev=700830&r1=700829&r2=700830&view=diff
==============================================================================
--- ode/sandbox/simpel/Rakefile (original)
+++ ode/sandbox/simpel/Rakefile Wed Oct  1 09:42:21 2008
@@ -86,5 +86,6 @@
   compile.with HSQLDB, JAVAX.resource, JAVAX.transaction, COMMONS.lang, COMMONS.logging, ODE, LOG4J, 
     WSDL4J, GERONIMO.transaction, XERCES,
     file(_("lib/e4x-grammar-0.1.jar")), ANTLR, file(_("lib/rhino-1.7R2pre-patched.jar"))
+  test.using :fork => :each
   package :jar
 end

Modified: ode/sandbox/simpel/lib/rhino-1.7R2pre-patched.jar
URL: http://svn.apache.org/viewvc/ode/sandbox/simpel/lib/rhino-1.7R2pre-patched.jar?rev=700830&r1=700829&r2=700830&view=diff
==============================================================================
Files ode/sandbox/simpel/lib/rhino-1.7R2pre-patched.jar (original) and ode/sandbox/simpel/lib/rhino-1.7R2pre-patched.jar Wed Oct  1 09:42:21 2008 differ

Modified: ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/SimPELCompiler.java
URL: http://svn.apache.org/viewvc/ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/SimPELCompiler.java?rev=700830&r1=700829&r2=700830&view=diff
==============================================================================
--- ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/SimPELCompiler.java (original)
+++ ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/SimPELCompiler.java Wed Oct  1 09:42:21 2008
@@ -14,11 +14,10 @@
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Scriptable;
 import org.mozilla.javascript.serialize.ScriptableOutputStream;
+import org.mozilla.javascript.serialize.ScriptableInputStream;
 import uk.co.badgersinfoil.e4x.antlr.*;
 
-import java.io.StringReader;
-import java.io.IOException;
-import java.io.ByteArrayOutputStream;
+import java.io.*;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.HashMap;

Modified: ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/expr/E4XExprRuntime.java
URL: http://svn.apache.org/viewvc/ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/expr/E4XExprRuntime.java?rev=700830&r1=700829&r2=700830&view=diff
==============================================================================
--- ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/expr/E4XExprRuntime.java (original)
+++ ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/expr/E4XExprRuntime.java Wed Oct  1 09:42:21 2008
@@ -30,7 +30,7 @@
  */
 public class E4XExprRuntime implements ExpressionLanguageRuntime {
 
-    private static ConcurrentHashMap<Integer, Scriptable> globalStateCache = new ConcurrentHashMap<Integer, Scriptable>();
+    private static ConcurrentHashMap<String, Scriptable> globalStateCache = new ConcurrentHashMap<String, Scriptable>();
 
     public void initialize(Map map) throws ConfigurationException {
     }
@@ -63,7 +63,7 @@
 
         Scriptable parentScope;
         if (oexpr.getOwner().globalState != null) {
-            parentScope = globalStateCache.get(oexpr.getOwner().getId());
+            parentScope = globalStateCache.get(oexpr.getOwner().getGuid());
             if (parentScope == null) {
                 Scriptable sharedScope = cx.initStandardObjects();
                 try {
@@ -73,7 +73,7 @@
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
-                globalStateCache.put(oexpr.getOwner().getId(), parentScope);
+                globalStateCache.put(oexpr.getOwner().getGuid(), parentScope);
             }
         } else {
             parentScope = cx.initStandardObjects();

Modified: ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/omodel/OBuilder.java
URL: http://svn.apache.org/viewvc/ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/omodel/OBuilder.java?rev=700830&r1=700829&r2=700830&view=diff
==============================================================================
--- ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/omodel/OBuilder.java (original)
+++ ode/sandbox/simpel/src/main/java/org/apache/ode/simpel/omodel/OBuilder.java Wed Oct  1 09:42:21 2008
@@ -247,6 +247,7 @@
     public void addVariableDecl(String varName, String modifiers) {
         if (variables.get(varName) != null)
             throw new RuntimeException("Duplicate definition of variable " + varName);
+        if (modifiers == null) return;
 
         if (modifiers.indexOf("unique") >= 0) {
             OProcess.OProperty oproperty = new OProcess.OProperty(_oprocess);
@@ -258,6 +259,7 @@
             propVar.name = varName;
             propVar.declaringScope = _oprocess.processScope;
             variables.put(varName, propVar);
+            typedVariables.add(varName);
 
             // TODO get rid of this dummy correlation set, we should be able to access properties directly
             OScope.CorrelationSet set = new OScope.CorrelationSet(_oprocess);