cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r557311 - /cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/ForEach.java
Date Wed, 18 Jul 2007 16:06:47 GMT
Author: gkossakowski
Date: Wed Jul 18 09:06:46 2007
New Revision: 557311

URL: http://svn.apache.org/viewvc?view=rev&rev=557311
Log:
COCOON-2092: Use local context helper methods in ForEach.

Modified:
    cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/ForEach.java

Modified: cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/ForEach.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/ForEach.java?view=diff&rev=557311&r1=557310&r2=557311
==============================================================================
--- cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/ForEach.java
(original)
+++ cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/ForEach.java
Wed Jul 18 09:06:46 2007
@@ -111,6 +111,7 @@
             throw new SAXParseException(err.getMessage(),
                                         getLocation(), new ErrorHolder(err));
         }
+        expressionContext.getObjectModel().markLocalContext();
         int i = 0;
         // Move to the begin row
         while (i < begin && iter.hasNext()) {
@@ -128,6 +129,7 @@
         }
         int skipCounter, count = 1;
         while (i <= end && iter.hasNext()) {
+            expressionContext.getObjectModel().markLocalContext();
             Object value = iter.next();
             expressionContext.getObjectModel().put(ObjectModel.CONTEXTBEAN, value);
             if (var != null) {
@@ -151,11 +153,9 @@
             i += step;
             count++;
             
-            expressionContext.getObjectModel().remove(ObjectModel.CONTEXTBEAN, value);
-            expressionContext.getObjectModel().remove(var, value);
+            expressionContext.getObjectModel().cleanupLocalContext();
         }
-        if (status != null)
-            expressionContext.getObjectModel().remove(varStatus, status);
+        expressionContext.getObjectModel().cleanupLocalContext();
             
         return getEndInstruction().getNext();
     }



Mime
View raw message