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

Michael Wilde wilde at mcs.anl.gov
Fri Nov 25 19:52:26 CST 2011


Mihael, this does not fix the bug that I reported in bug 644, but it does seem to clarify the cause: the test case in bug 644 now gives the message:

	?:file[2] - Closed is not a mapped type

@filenames() should only be looking at array elements [0] and [1] - seems to me that its going beyond the assigned elements of the array to complain about [2] not being mapped. If I set element [2] it complains about element [3] in the error message above.

Did you try the test case? That case should not generate an error - I believe that its a valid program. if you replace @filenames() with two calls to @filename() it works. Ie all elements of the array passed to @filenames() are properly mapped.

- Mike




----- Original Message -----
> From: hategan at ci.uchicago.edu
> To: swift-commit at ci.uchicago.edu
> Sent: Thursday, November 24, 2011 3:18:52 PM
> Subject: [Swift-commit] r5316 - in branches/release-0.93/src/org/griphyn/vdl: karajan/lib mapping
> 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;
> }
> 
> 
> _______________________________________________
> Swift-commit mailing list
> Swift-commit at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-commit

-- 
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory




More information about the Swift-devel mailing list