[Swift-commit] r5316 - in branches/release-0.93/src/org/griphyn/vdl: karajan/lib mapping

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Thu Nov 24 15:18:52 CST 2011


Author: hategan
Date: 2011-11-24 15:18:51 -0600 (Thu, 24 Nov 2011)
New Revision: 5316

Modified:
   branches/release-0.93/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
   branches/release-0.93/src/org/griphyn/vdl/mapping/AbstractDataNode.java
   branches/release-0.93/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
   branches/release-0.93/src/org/griphyn/vdl/mapping/RootDataNode.java
Log:
throw better exception than NPE when @filename is called with a non-mapped argument

Modified: branches/release-0.93/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
===================================================================
--- branches/release-0.93/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2011-11-23 19:33:26 UTC (rev 5315)
+++ branches/release-0.93/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2011-11-24 21:18:51 UTC (rev 5316)
@@ -197,8 +197,17 @@
 
 	private static String[] leavesFileNames(DSHandle var) throws ExecutionException, HandleOpenException {
 	    Mapper mapper;
+	    	    
         synchronized (var.getRoot()) {
-            mapper = var.getMapper();
+            if (var instanceof AbstractDataNode) {
+                mapper = ((AbstractDataNode) var).getActualMapper();
+                if (mapper == null) {
+                    throw new ExecutionException(var + " is not a mapped type");
+                }
+            }
+            else {
+                mapper = var.getMapper();
+            }
         }
 		List<String> l = new ArrayList<String>();
 		try {

Modified: branches/release-0.93/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- branches/release-0.93/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2011-11-23 19:33:26 UTC (rev 5315)
+++ branches/release-0.93/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2011-11-24 21:18:51 UTC (rev 5316)
@@ -513,7 +513,7 @@
         }
     }
     
-    protected Mapper getActualMapper() {
+    public Mapper getActualMapper() {
         return null;
     }
 

Modified: branches/release-0.93/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
===================================================================
--- branches/release-0.93/src/org/griphyn/vdl/mapping/RootArrayDataNode.java	2011-11-23 19:33:26 UTC (rev 5315)
+++ branches/release-0.93/src/org/griphyn/vdl/mapping/RootArrayDataNode.java	2011-11-24 21:18:51 UTC (rev 5316)
@@ -103,7 +103,7 @@
         throw new FutureNotYetAvailable(waitingMapperParam.getFutureWrapper());
 	}
 	
-	protected Mapper getActualMapper() {
+	public Mapper getActualMapper() {
         return mapper;
     }
 

Modified: branches/release-0.93/src/org/griphyn/vdl/mapping/RootDataNode.java
===================================================================
--- branches/release-0.93/src/org/griphyn/vdl/mapping/RootDataNode.java	2011-11-23 19:33:26 UTC (rev 5315)
+++ branches/release-0.93/src/org/griphyn/vdl/mapping/RootDataNode.java	2011-11-24 21:18:51 UTC (rev 5316)
@@ -213,7 +213,7 @@
         throw new FutureNotYetAvailable(waitingMapperParam.getFutureWrapper());
 	}
 	
-	protected Mapper getActualMapper() {
+	public Mapper getActualMapper() {
         return mapper;
     }
 




More information about the Swift-commit mailing list