[Swift-commit] r5934 - trunk/src/org/griphyn/vdl/karajan/lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Tue Sep 18 23:24:57 CDT 2012


Author: hategan
Date: 2012-09-18 23:24:57 -0500 (Tue, 18 Sep 2012)
New Revision: 5934

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/TCProfile.java
Log:
fix setting of dynamic attributes that are passed to execute() as arguments

Modified: trunk/src/org/griphyn/vdl/karajan/lib/TCProfile.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/TCProfile.java	2012-09-18 21:47:01 UTC (rev 5933)
+++ trunk/src/org/griphyn/vdl/karajan/lib/TCProfile.java	2012-09-19 04:24:57 UTC (rev 5934)
@@ -22,6 +22,7 @@
 
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -199,14 +200,25 @@
 		}
 	}
 	
-	private void addAttributes(NamedArguments named, 
-	                           Map<String,Object> attrs) {
+	private void addAttributes(NamedArguments named, Map<String,Object> attrs) {
 	    if (logger.isDebugEnabled()) {
 	        logger.debug("Attributes: " + attrs);
 	    }
-	    if (attrs == null || attrs.size() == 0) {
+	    if (attrs == null) {
 	        return;
 	    }
+	    Iterator<Map.Entry<String, Object>> i = attrs.entrySet().iterator();
+	    while (i.hasNext()) {
+	        Map.Entry<String, Object> e = i.next();
+	        Arg a = PROFILE_T.get(e.getKey());
+	        if (a != null) {
+	            named.add(a, e.getValue());
+	            i.remove();
+	        }
+	    }
+	    if (attrs.size() == 0) {
+	        return;
+	    }
 	    named.add(GridExec.A_ATTRIBUTES, attrs);
 	}
 




More information about the Swift-commit mailing list