[Swift-commit] r2376 - in trunk: resources src/org/griphyn/vdl/karajan/lib

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Dec 15 20:46:27 CST 2008


Author: benc
Date: 2008-12-15 20:46:26 -0600 (Mon, 15 Dec 2008)
New Revision: 2376

Modified:
   trunk/resources/Karajan.stg
   trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
Log:
move field value retrieval into setfieldvalue implementation

Modified: trunk/resources/Karajan.stg
===================================================================
--- trunk/resources/Karajan.stg	2008-12-16 00:02:43 UTC (rev 2375)
+++ trunk/resources/Karajan.stg	2008-12-16 02:46:26 UTC (rev 2376)
@@ -289,11 +289,7 @@
        $var$
      </argument>
      <argument name="value">
-<!-- TODO this should be removed and the equivalent code put in the
-java implementation of setfieldvalue itself -->
-<getfieldvalue>
        $value$
-</getfieldvalue>
      </argument>
    </vdl:setfieldvalue>
 >>

Modified: trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2008-12-16 00:02:43 UTC (rev 2375)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2008-12-16 02:46:26 UTC (rev 2376)
@@ -26,7 +26,7 @@
 		try {
 			Path path = parsePath(OA_PATH.getValue(stack), stack);
 			DSHandle leaf = var.getField(path);
-			Object value = PA_VALUE.getValue(stack);
+			DSHandle value = (DSHandle)PA_VALUE.getValue(stack);
 			if (logger.isInfoEnabled()) {
 				logger.info("Setting " + leaf + " to " + value);
 			}
@@ -39,10 +39,16 @@
 				// leaf.setValue(internalValue(leaf.getType(), value));
 				if( (value instanceof DSHandle && ((DSHandle)value).getType().isArray()) || (value instanceof PairIterator)) {
 					logger.warn("Warning: array assignment outside of initialisation does not work correctly.");
+				} else {
+					synchronized(value.getRoot()) {
+						if (!value.isClosed()) {
+							throw new FutureNotYetAvailable(addFutureListener(stack,value));
+						} else {
+							leaf.setValue(value.getValue());
+							closeShallow(stack, leaf);
+						}
+					}
 				}
-
-				leaf.setValue(value);
-				closeShallow(stack, leaf);
 			}
 			return null;
 		}




More information about the Swift-commit mailing list