Author: mriou
Date: Mon Jun 18 16:09:43 2007
New Revision: 548527

URL: http://svn.apache.org/viewvc?view=rev&rev=548527
Log:
Getting the proper lvalue variable if there are more than one referenced.

Modified:
    
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xpath10/o/OXPath10Expression.java

Modified: 
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xpath10/o/OXPath10Expression.java
URL: 
http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xpath10/o/OXPath10Expression.java?view=diff&rev=548527&r1=548526&r2=548527
==============================================================================
--- 
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xpath10/o/OXPath10Expression.java
 (original)
+++ 
incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/elang/xpath10/o/OXPath10Expression.java
 Mon Jun 18 16:09:43 2007
@@ -168,7 +168,13 @@
        public Variable getVariable() {
                if(vars.size() == 0)
                        throw new IllegalStateException("LValue must have one 
variable reference.");
-               return vars.values().iterator().next();
+        // We're interested in the first variable referenced by the LValue
+        for (String varName : vars.keySet()) {
+            if (xpath.substring(1, xpath.length()).startsWith(varName))
+                return vars.get(varName);
+        }
+        throw new IllegalStateException("Either the expression doesn't start 
with a variable reference or " +
+                "the reference is unknow.");
        }
 
 }


Reply via email to