Print

Print


Commit in GeomConverter/src/org/lcsim/detector on MAIN
DetectorElement.java+8-11.41 -> 1.42
check for path not found

GeomConverter/src/org/lcsim/detector
DetectorElement.java 1.41 -> 1.42
diff -u -r1.41 -r1.42
--- DetectorElement.java	3 Mar 2009 21:06:41 -0000	1.41
+++ DetectorElement.java	18 Mar 2009 04:44:06 -0000	1.42
@@ -15,7 +15,7 @@
  * Implementation of {@link IDetectorElement}.
  * 
  * @author Jeremy McCormick
- * @version $Id: DetectorElement.java,v 1.41 2009/03/03 21:06:41 jeremy Exp $
+ * @version $Id: DetectorElement.java,v 1.42 2009/03/18 04:44:06 jeremy Exp $
  */
 public class DetectorElement 
 implements IDetectorElement
@@ -651,6 +651,13 @@
     		if (matches.size() > 1)
     			throw new RuntimeException("Found more than one match for path component <" + path[i] + ">.");
     		
+    		// Check if no matches were found.
+    		// FIXME: Should this throw an exception or just return null?
+    		if (matches.size() < 0)
+    		{
+    		    throw new RuntimeException("A DetectorElement for the path component " + path[i] + " was not found."); 
+    		}
+    		    
     		de = matches.get(0);
     	}
     	return de;
CVSspam 0.2.8