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

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Jul 14 17:18:47 CDT 2008


Author: hategan
Date: 2008-07-14 17:18:46 -0500 (Mon, 14 Jul 2008)
New Revision: 2115

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
Log:
improved error message when header does not match type

Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java	2008-07-11 18:04:12 UTC (rev 2114)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/ReadData.java	2008-07-14 22:18:46 UTC (rev 2115)
@@ -161,10 +161,14 @@
 			String[] header = line.split("\\s+");
 			Set t = new HashSet(type.getFieldNames());
 			Set h = new HashSet(Arrays.asList(header));
+			if (t.size() != h.size()) {
+				throw new ExecutionException("File header does not match type. " + "Expected "
+						+ t.size() + " whitespace separated items. Got " + h.size() + " instead.");
+			}
 			if (!t.equals(h)) {
 				throw new ExecutionException("File header does not match type. "
-						+ "Expected the following header items (in no particular order): " + t
-						+ ". Instead, the header was (again, in no particular order): " + h);
+						+ "Expected the following whitespace separated header items: " + t
+						+ ". Instead, the header was: " + h);
 			}
 			return header;
 		}




More information about the Swift-commit mailing list