[Swift-commit] r4472 - trunk/src/org/griphyn/vdl/mapping

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Fri May 13 18:11:48 CDT 2011


Author: hategan
Date: 2011-05-13 18:11:48 -0500 (Fri, 13 May 2011)
New Revision: 4472

Modified:
   trunk/src/org/griphyn/vdl/mapping/RootDataNode.java
Log:
fixed issue where odd exception would be thrown when using dependent mapper params

Modified: trunk/src/org/griphyn/vdl/mapping/RootDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/RootDataNode.java	2011-05-13 20:21:23 UTC (rev 4471)
+++ trunk/src/org/griphyn/vdl/mapping/RootDataNode.java	2011-05-13 23:11:48 UTC (rev 4472)
@@ -58,9 +58,13 @@
 		}
 		try {
 			mapper = MapperFactory.getMapper(desc, params);
+			getField().setName(PARAM_PREFIX.getStringValue(mapper));
+			// initialized means that this data has its mapper initialized
+			// this should be called before checkInputs because the latter
+			// may trigger calls to things that try to access this data node's
+			// mapper
+            initialized();
 			checkInputs();
-			getField().setName(PARAM_PREFIX.getStringValue(mapper));
-			initialized();
 		}
 		catch (InvalidMapperException e) {
 			throw new RuntimeException("InvalidMapperException caught in mapper initialization", e);
@@ -202,10 +206,11 @@
 
 
 	public Mapper getMapper() {
-		if(initialized) {
+		if (initialized) {
 			return mapper;
-		} else {
-			assert(waitingMapperParam != null);
+		} 
+		else {
+			assert (waitingMapperParam != null);
             throw new VDL2FutureException(waitingMapperParam);
 		}
 	}
@@ -220,6 +225,7 @@
 	}
 
 	private void initialized() {
-		initialized=true;
+		initialized = true;
+		waitingMapperParam = null;
 	}
 }




More information about the Swift-commit mailing list