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

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Dec 3 12:03:29 CST 2009


Author: wozniak
Date: 2009-12-03 12:03:29 -0600 (Thu, 03 Dec 2009)
New Revision: 3195

Modified:
   trunk/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java
Log:
Minor error message improvement to regexp_mapper. 


Modified: trunk/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java	2009-11-30 20:48:30 UTC (rev 3194)
+++ trunk/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java	2009-12-03 18:03:29 UTC (rev 3195)
@@ -60,9 +60,15 @@
 		Matcher m2 = p2.matcher(transform);
 		StringBuffer sb = new StringBuffer();
 		while (m2.find()) {
-			String group = m2.group(1);
+                        String group = m2.group(1);
 			int g = Integer.parseInt(group.substring(1));
-			m2.appendReplacement(sb, m.group(g));
+                        try { 
+         			m2.appendReplacement(sb, m.group(g));
+                        }
+                        catch (IndexOutOfBoundsException e)
+                        {
+                                throw new RuntimeException("regexp_mapper error: No group: \\\\" + g);
+                        }
 		}
 		m2.appendTail(sb);
 		return new AbsFile(sb.toString());




More information about the Swift-commit mailing list