[Swift-commit] r7778 - in branches/release-0.94/src/org/griphyn/vdl/karajan/lib: . swiftscript

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Thu Apr 17 23:17:18 CDT 2014


Author: hategan
Date: 2014-04-17 23:17:18 -0500 (Thu, 17 Apr 2014)
New Revision: 7778

Added:
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/SwiftFunctionsCollection.java
Modified:
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/Tracer.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ExtractInt.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileName.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileNames.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Fprintf.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Tracef.java
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/WriteData.java
Log:
fixed lazy errors not working with assignments and built-in functions/procedures

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -36,6 +36,8 @@
 import org.griphyn.vdl.karajan.WaitingThreadsMonitor;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.DataDependentException;
+import org.griphyn.vdl.mapping.DependentException;
 import org.griphyn.vdl.mapping.InvalidPathException;
 import org.griphyn.vdl.mapping.Mapper;
 import org.griphyn.vdl.mapping.Path;
@@ -126,7 +128,13 @@
     /** make dest look like source - if its a simple value, copy that
 	    and if its an array then recursively copy */
 	public static void deepCopy(DSHandle dest, DSHandle source, VariableStack stack, int level) throws ExecutionException {
-	    ((AbstractDataNode) source).waitFor();
+	    try {
+	        ((AbstractDataNode) source).waitFor();
+	    }
+	    catch (DependentException e) {
+	        dest.setValue(new DataDependentException(dest, e));
+	        return;
+	    }
 		if (source.getType().isPrimitive()) {
 			dest.setValue(source.getValue());
 		}

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/Tracer.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/Tracer.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/Tracer.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -24,6 +24,7 @@
 import org.griphyn.vdl.karajan.FutureWrapper;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.DependentException;
 import org.griphyn.vdl.mapping.Mapper;
 import org.griphyn.vdl.mapping.Path;
 import org.griphyn.vdl.type.Types;
@@ -261,20 +262,25 @@
         if (o instanceof AbstractDataNode) {
             AbstractDataNode h = (AbstractDataNode) o;
             if (h.isClosed()) {
-                if (h.getType().isPrimitive()) {
-                    if (Types.STRING.equals(h.getType())) {
-                        return "\"" + h.getValue() + '"';
+                try {
+                    if (h.getType().isPrimitive()) {
+                        if (Types.STRING.equals(h.getType())) {
+                            return "\"" + h.getValue() + '"';
+                        }
+                        else {
+                            return h.getValue();
+                        }
                     }
+                    else if (h.getType().isComposite()){
+                        return getVarName(h);
+                    }
                     else {
-                        return h.getValue();
+                        return fileName(h);
                     }
                 }
-                else if (h.getType().isComposite()){
-                    return getVarName(h);
+                catch (DependentException e) {
+                    return "<exception>";
                 }
-                else {
-                    return fileName(h);
-                }
             }
             else {
                 return "?" + getVarName(h);

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -39,20 +39,19 @@
 import org.globus.cog.karajan.util.TypeUtil;
 import org.globus.cog.karajan.workflow.ExecutionException;
 import org.globus.cog.karajan.workflow.KarajanRuntimeException;
-import org.globus.cog.karajan.workflow.futures.Future;
 import org.globus.cog.karajan.workflow.nodes.SequentialWithArguments;
 import org.globus.cog.karajan.workflow.nodes.restartLog.RestartLog;
 import org.globus.swift.catalog.TCEntry;
 import org.globus.swift.catalog.transformation.File;
 import org.globus.swift.catalog.types.TCType;
 import org.griphyn.vdl.karajan.AssertFailedException;
-import org.griphyn.vdl.karajan.FutureWrapper;
 import org.griphyn.vdl.karajan.Loader;
 import org.griphyn.vdl.karajan.TCCache;
 import org.griphyn.vdl.karajan.functions.ConfigProperty;
 import org.griphyn.vdl.mapping.AbsFile;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.DataDependentException;
 import org.griphyn.vdl.mapping.DependentException;
 import org.griphyn.vdl.mapping.GeneralizedFileFormat;
 import org.griphyn.vdl.mapping.HandleOpenException;
@@ -61,6 +60,7 @@
 import org.griphyn.vdl.mapping.Path;
 import org.griphyn.vdl.mapping.PathComparator;
 import org.griphyn.vdl.mapping.PhysicalFormat;
+import org.griphyn.vdl.mapping.RootDataNode;
 import org.griphyn.vdl.type.Type;
 import org.griphyn.vdl.type.Types;
 import org.griphyn.vdl.util.FQN;
@@ -95,11 +95,16 @@
             throw e;
         }
 		catch (DependentException e) {
-			// This would not be the primal fault so in non-lazy errors mode it
-			// should not matter
-			throw new ExecutionException(stack, e);
+		    RootDataNode r = new RootDataNode(getReturnType());
+		    r.setValue(new DataDependentException(r, e));
+			ret(stack, r);
+			super.post(stack);
 		}
 	}
+	
+	protected Type getReturnType() {
+	    return Types.ANY;
+	}
 
 	protected void ret(VariableStack stack, final Object value) throws ExecutionException {
 		if (value != null) {

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ExtractInt.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ExtractInt.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ExtractInt.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -29,6 +29,7 @@
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
 import org.griphyn.vdl.mapping.RootDataNode;
+import org.griphyn.vdl.type.Type;
 import org.griphyn.vdl.type.Types;
 
 
@@ -37,7 +38,12 @@
 		setArguments(ExtractInt.class, new Arg[] { PA_VAR });
 	}
 
-	public Object function(VariableStack stack) throws ExecutionException {
+	@Override
+    protected Type getReturnType() {
+        return Types.INT;
+    }
+
+    public Object function(VariableStack stack) throws ExecutionException {
 		AbstractDataNode handle = null;
 		try {
 			handle = (AbstractDataNode) PA_VAR.getValue(stack);

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileName.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileName.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileName.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -23,12 +23,18 @@
 import org.griphyn.vdl.karajan.lib.VDLFunction;
 import org.griphyn.vdl.mapping.DSHandle;
 import org.griphyn.vdl.mapping.RootDataNode;
+import org.griphyn.vdl.type.Type;
 import org.griphyn.vdl.type.Types;
 
 public class FileName extends VDLFunction {
 	static {
 		setArguments(FileName.class, new Arg[] { PA_VAR });
 	}
+	
+	@Override
+    protected Type getReturnType() {
+        return Types.STRING;
+    }
 
 	public Object function(VariableStack stack) throws ExecutionException {
 		String s = argList(filename(stack), true);

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileNames.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileNames.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/FileNames.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -27,14 +27,19 @@
 import org.griphyn.vdl.mapping.DSHandle;
 import org.griphyn.vdl.mapping.InvalidPathException;
 import org.griphyn.vdl.mapping.Path;
-import org.griphyn.vdl.mapping.RootDataNode;
 import org.griphyn.vdl.mapping.RootArrayDataNode;
+import org.griphyn.vdl.type.Type;
 import org.griphyn.vdl.type.Types;
 
 public class FileNames extends VDLFunction {
 	static {
 		setArguments(FileNames.class, new Arg[] { PA_VAR });
 	}
+	
+	@Override
+    protected Type getReturnType() {
+        return Types.STRING.arrayType();
+    }
 
 	public Object function(VariableStack stack) throws ExecutionException {
 		String[] f = filename(stack);

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Fprintf.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Fprintf.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Fprintf.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -28,6 +28,7 @@
 import org.griphyn.vdl.karajan.lib.VDLFunction;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.DependentException;
 import org.griphyn.vdl.type.Types;
 
 /**
@@ -52,20 +53,25 @@
     @Override
     protected Object function(VariableStack stack) 
     throws ExecutionException {
-        AbstractDataNode[] args = waitForAllVargs(stack);
-        
-        check(args);
-        
-        String filename = (String) args[0].getValue();
-        String spec = (String) args[1].getValue(); 
-        DSHandle[] vars = Sprintf.copyArray(args, 2, args.length-2);
-        
-        StringBuilder output = new StringBuilder();
-        Sprintf.format(spec, vars, output);
-        String msg = output.toString();
- 
-        logger.debug("file: " + filename + " msg: " + msg);        
-        write(filename, msg);
+        try {
+            AbstractDataNode[] args = waitForAllVargs(stack);
+            
+            check(args);
+            
+            String filename = (String) args[0].getValue();
+            String spec = (String) args[1].getValue(); 
+            DSHandle[] vars = Sprintf.copyArray(args, 2, args.length-2);
+            
+            StringBuilder output = new StringBuilder();
+            Sprintf.format(spec, vars, output);
+            String msg = output.toString();
+     
+            logger.debug("file: " + filename + " msg: " + msg);        
+            write(filename, msg);
+        }
+        catch (DependentException e) {
+            logger.debug("<exception>");
+        }
         return null;
     }
     

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -27,7 +27,6 @@
 import org.globus.cog.karajan.stack.VariableStack;
 import org.globus.cog.karajan.util.TypeUtil;
 import org.globus.cog.karajan.workflow.ExecutionException;
-import org.globus.cog.karajan.workflow.nodes.functions.FunctionsCollection;
 import org.griphyn.vdl.karajan.lib.SwiftArg;
 import org.griphyn.vdl.karajan.lib.VDLFunction;
 import org.griphyn.vdl.mapping.AbsFile;
@@ -40,7 +39,7 @@
 import org.griphyn.vdl.type.Types;
 import org.griphyn.vdl.util.VDL2Config;
 
-public class Misc extends FunctionsCollection {
+public class Misc extends SwiftFunctionsCollection {
 
 	private static final Logger logger = Logger.getLogger(Misc.class);
 
@@ -52,24 +51,60 @@
 
 	static {
         setArguments("swiftscript_dirname", new Arg[] { PA_FILE });
+        setReturnType("swiftscript_dirname", Types.STRING);
+        
 	    setArguments("swiftscript_exists", new Arg[] { Arg.VARGS });
+	    setReturnType("swiftscript_exists", Types.BOOLEAN);
+	    
         setArguments("swiftscript_existsfile", new Arg[] { PA_FILE });
+        setReturnType("swiftscript_existsfile", Types.BOOLEAN);
+        
         setArguments("swiftscript_format", new Arg[] { PA_INPUT, PA_TRANSFORM });
+        setReturnType("swiftscript_format", Types.STRING);
+        
         setArguments("swiftscript_length", new Arg[] { PA_ARRAY });
+        setReturnType("swiftscript_length", Types.INT);
+        
         setArguments("swiftscript_pad", new Arg[] { PA_INPUT, PA_TRANSFORM });
+        setReturnType("swiftscript_pad", Types.STRING);
+        
         setArguments("swiftscript_regexp", new Arg[] { PA_INPUT, PA_PATTERN, PA_TRANSFORM });
+        setReturnType("swiftscript_regext", Types.STRING);
+        
         setArguments("swiftscript_strcat",  new Arg[] { Arg.VARGS });
+        setReturnType("swiftscript_strcat", Types.STRING);
+        
         setArguments("swiftscript_strcut", new Arg[] { PA_INPUT, PA_PATTERN });
+        setReturnType("swiftscript_strcut", Types.STRING);
+        
         setArguments("swiftscript_strsplit", new Arg[] { PA_INPUT, PA_PATTERN });
+        setReturnType("swiftscript_strsplit", Types.STRING.arrayType());
+        
         setArguments("swiftscript_strjoin", new Arg[] { PA_ARRAY, PA_INPUT });
+        setReturnType("swiftscript_strjoin", Types.STRING);
+        
         setArguments("swiftscript_strstr", new Arg[] { PA_INPUT, PA_PATTERN });
+        setReturnType("swiftscript_strstr", Types.STRING);
+        
 		setArguments("swiftscript_trace", new Arg[] { Arg.VARGS });
+		
         setArguments("swiftscript_to_int", new Arg[] { PA_INPUT });
+        setReturnType("swiftscript_to_int", Types.INT);
+        
 		setArguments("swiftscript_toint", new Arg[] { PA_INPUT });
+		setReturnType("swiftscript_toint", Types.INT);
+		
         setArguments("swiftscript_to_float", new Arg[] { PA_INPUT });
+        setReturnType("swiftscript_to_float", Types.FLOAT);
+        
 		setArguments("swiftscript_tofloat", new Arg[] { PA_INPUT });
+		setReturnType("swiftscript_tofloat", Types.FLOAT);
+		
         setArguments("swiftscript_to_string", new Arg[] { PA_INPUT });
+        setReturnType("swiftscript_to_string", Types.STRING);
+        
         setArguments("swiftscript_tostring", new Arg[] { PA_INPUT });
+        setReturnType("swiftscript_tostring", Types.STRING);
 	}
 
 	private static final Logger traceLogger =

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -37,6 +37,8 @@
 import org.griphyn.vdl.mapping.AbsFile;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.DataDependentException;
+import org.griphyn.vdl.mapping.DependentException;
 import org.griphyn.vdl.mapping.InvalidPathException;
 import org.griphyn.vdl.mapping.Path;
 import org.griphyn.vdl.mapping.PhysicalFormat;
@@ -68,7 +70,13 @@
 		if (tracer.isEnabled()) {
 		    tracer.trace(stack, "readData(" + Tracer.unwrapHandle(src) + ")");
 		}
-		src.waitFor();
+		try {
+		    src.waitFor();
+		}
+		catch (DependentException e) {
+		    dest.setValue(new DataDependentException(dest, e));
+		    return null;
+		}
 		if (src.getType().equals(Types.STRING)) {
 			readData(dest, (String) src.getValue());
 		}

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadStructured.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -34,6 +34,8 @@
 import org.griphyn.vdl.mapping.AbsFile;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.DataDependentException;
+import org.griphyn.vdl.mapping.DependentException;
 import org.griphyn.vdl.mapping.Path;
 import org.griphyn.vdl.mapping.PhysicalFormat;
 import org.griphyn.vdl.type.Types;
@@ -63,7 +65,13 @@
 		if (tracer.isEnabled()) {
             tracer.trace(stack, "readData2(" + Tracer.unwrapHandle(src) + ")");
         }
-        src.waitFor();
+        try {
+            src.waitFor();
+        }
+        catch (DependentException e) {
+            dest.setValue(new DataDependentException(dest, e));
+            return null;
+        }
 		if (src.getType().equals(Types.STRING)) {
 			readData(dest, (String) src.getValue());
 			dest.closeDeep();

Added: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/SwiftFunctionsCollection.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/SwiftFunctionsCollection.java	                        (rev 0)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/SwiftFunctionsCollection.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -0,0 +1,70 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Apr 17, 2014
+ */
+package org.griphyn.vdl.karajan.lib.swiftscript;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.globus.cog.karajan.stack.VariableStack;
+import org.globus.cog.karajan.workflow.ExecutionException;
+import org.globus.cog.karajan.workflow.futures.FutureNotYetAvailable;
+import org.globus.cog.karajan.workflow.nodes.functions.FunctionsCollection;
+import org.griphyn.vdl.mapping.DataDependentException;
+import org.griphyn.vdl.mapping.DependentException;
+import org.griphyn.vdl.mapping.RootDataNode;
+import org.griphyn.vdl.type.Type;
+import org.griphyn.vdl.type.Types;
+
+public class SwiftFunctionsCollection extends FunctionsCollection {
+    private static Map<String, Type> returnTypes;
+    
+    static {
+        returnTypes = new HashMap<String, Type>();
+    }
+    
+    protected static void setReturnType(String name, Type rt) {
+        returnTypes.put(name, rt);
+    }
+    
+    protected Type getReturnType() {
+        Type t = returnTypes.get(getMethod().getName());
+        if (t == null) {
+            return Types.ANY;
+        }
+        else {
+            return t;
+        }
+    }
+    
+    public Object function(VariableStack stack) throws ExecutionException {
+        try {
+            return getMethod().invoke(this, stack);
+        }
+        catch (InvocationTargetException e) {
+            Throwable ex = e.getTargetException();
+            if (ex instanceof ExecutionException) {
+                throw (ExecutionException) ex;
+            }
+            else if (ex instanceof FutureNotYetAvailable) {
+                throw (FutureNotYetAvailable) ex;
+            }
+            else if (ex instanceof DependentException) {
+                RootDataNode rdn = new RootDataNode(getReturnType());
+                rdn.setValue(new DataDependentException(rdn, (DependentException) ex));
+                return rdn;
+            }
+            throw new ExecutionException(e.getTargetException());
+        }
+        catch (Exception e) {
+            throw new ExecutionException(e);
+        }
+    }
+}

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Tracef.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Tracef.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/Tracef.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -23,6 +23,7 @@
 import org.globus.cog.karajan.workflow.ExecutionException;
 import org.griphyn.vdl.karajan.lib.VDLFunction;
 import org.griphyn.vdl.mapping.AbstractDataNode;
+import org.griphyn.vdl.mapping.DependentException;
 
 /**
     Formatted trace output. <br>
@@ -46,11 +47,16 @@
     @Override
     protected Object function(VariableStack stack) 
     throws ExecutionException {
-        AbstractDataNode[] args = waitForAllVargs(stack);
-
-        String msg = Sprintf.format(args);
-        logger.info(msg);
-        System.out.print(msg);
+        try {
+            AbstractDataNode[] args = waitForAllVargs(stack);
+    
+            String msg = Sprintf.format(args);
+            logger.info(msg);
+            System.out.print(msg);
+        }
+        catch (DependentException e) {
+            logger.info("tracef(): <exception>");
+        }
         return null;
     }
 }

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/WriteData.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/WriteData.java	2014-04-18 01:29:19 UTC (rev 7777)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/swiftscript/WriteData.java	2014-04-18 04:17:18 UTC (rev 7778)
@@ -33,6 +33,8 @@
 import org.griphyn.vdl.mapping.AbsFile;
 import org.griphyn.vdl.mapping.AbstractDataNode;
 import org.griphyn.vdl.mapping.DSHandle;
+import org.griphyn.vdl.mapping.DataDependentException;
+import org.griphyn.vdl.mapping.DependentException;
 import org.griphyn.vdl.mapping.HandleOpenException;
 import org.griphyn.vdl.mapping.InvalidPathException;
 import org.griphyn.vdl.mapping.Path;
@@ -59,7 +61,13 @@
 		// src can be any of several forms of value
 		AbstractDataNode src = (AbstractDataNode) SRC.getValue(stack);
 
-		src.waitFor();
+		try {
+            src.waitFor();
+        }
+        catch (DependentException e) {
+            dest.setValue(new DataDependentException(dest, e));
+            return null;
+        }
 
 		if (dest.getType().equals(Types.STRING)) {
 			writeData((String)dest.getValue(), src);




More information about the Swift-commit mailing list