[Swift-commit] cog r3663

swift at ci.uchicago.edu swift at ci.uchicago.edu
Sat May 18 22:50:05 CDT 2013


------------------------------------------------------------------------
r3663 | hategan | 2013-05-18 22:49:03 -0500 (Sat, 18 May 2013) | 1 line

fix re-running of import statements in the same jvm
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/nodes/Include.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/nodes/Include.java	(revision 3662)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/nodes/Include.java	(working copy)
@@ -56,6 +56,20 @@
 		}
 	}
 
+	@Override
+	protected void executeChildren(VariableStack stack) throws ExecutionException {
+		stack.setCaller(this);
+		synchronized (this) {
+			if (hasProperty("_processed")) {
+				setIndex(stack, (Integer) getProperty("_processed"));
+			}
+			else {
+				setIndex(stack, 0);
+			}
+		}
+		startNext(stack);
+	}
+
 	protected void checkArgs(VariableStack stack) throws ExecutionException {
 		if (A_FILE.isPresent(stack)) {
 			includeFile(TypeUtil.toString(A_FILE.getValue(stack)), stack);
@@ -142,7 +156,7 @@
 		if (hasProperty("_processed")) {
 			return;
 		}
-		setProperty("_processed", true);
+		setProperty("_processed", elementCount());
 		A_FILE.setStatic(this, iname);
 		logger.debug("Importing: " + iname);
 		Reader reader = null;



More information about the Swift-commit mailing list