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

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sun Mar 22 09:25:56 CDT 2009


Author: benc
Date: 2009-03-22 09:25:55 -0500 (Sun, 22 Mar 2009)
New Revision: 2730

Modified:
   trunk/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java
Log:
More checking of path validity in array_mapper

Modified: trunk/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java	2009-03-22 13:22:20 UTC (rev 2729)
+++ trunk/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java	2009-03-22 14:25:55 UTC (rev 2730)
@@ -33,8 +33,11 @@
 
 	public PhysicalFormat map(Path path) {
 
+		if (path.isEmpty()) {
+			throw new IllegalArgumentException("Path cannot be empty");
+		}
 		if (!path.isArrayIndex(0)) {
-			throw new IllegalArgumentException(path.toString());
+			throw new IllegalArgumentException("First element of path "+path.toString()+" must be an array index");
 		}
 		else {
 			// we could typecheck more elegantly here to make sure that




More information about the Swift-commit mailing list