Author: boisvert
Date: Thu Mar 19 20:51:37 2009
New Revision: 756187

URL: http://svn.apache.org/viewvc?rev=756187&view=rev
Log:
ODE-558: Better error reporting if <forEach> is missing child <scope>

Modified:
    
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
    
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGeneratorMessages.java

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java?rev=756187&r1=756186&r2=756187&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
 Thu Mar 19 20:51:37 2009
@@ -64,6 +64,10 @@
 
         // ForEach 'adds' a counter variable in inner scope
         if (__log.isDebugEnabled()) __log.debug("Adding the forEach counter 
variable to inner scope.");
+        if (forEach.getChild() == null) {
+            throw new 
CompilationException(__cmsgs.errMissingScopeinForeach().setSource(forEach));
+        }
+
         Scope s = forEach.getChild().getScope();
         // Checking if a variable using the same name as our counter is 
already defined.
         // The spec requires a static analysis error to be thrown in that case.

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGeneratorMessages.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGeneratorMessages.java?rev=756187&r1=756186&r2=756187&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGeneratorMessages.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGeneratorMessages.java
 Thu Mar 19 20:51:37 2009
@@ -30,4 +30,8 @@
             "variable named {0}, just like the forEach counterName.");
     }
 
+    public CompilationMessage errMissingScopeinForeach() {
+        return this.formatCompilationMessage("The <scope> activity requires a 
child scope");
+    }
+
 }


Reply via email to