GeomConverter/src/org/lcsim/detector
diff -u -r1.10 -r1.11
--- DetectorElementStore.java 28 Aug 2007 03:23:00 -0000 1.10
+++ DetectorElementStore.java 28 Aug 2007 06:24:56 -0000 1.11
@@ -20,12 +20,15 @@
}
public boolean add(IDetectorElement de)
- {
- // Add to list.
+ {
+ // Add to the list using super, which will check for dups, etc.
super.add(de);
//System.out.println("adding DetectorElement " + de.getName() +" ...");
+ //if (this.contains(de))
+ // throw new RuntimeException("weirdness! trying to add " + de.getName() + " twice!");
+
// Check to see if the id is cacheable ...
IIdentifier id = de.getIdentifier();
@@ -36,21 +39,21 @@
// Is the id flagged as valid?
if (id.isValid())
{
- IDetectorElementContainer dups = find(id);
+ //IDetectorElementContainer dups = find(id);
// Is the id unique?
- if (dups.size() > 0)
- {
- throw new IllegalArgumentException("Cannot add DetectorElement <"
- + de.getName() + "> because its identifier <"+id
- +"> is already used by <"+dups.get(0).getName()+">.");
- }
+ //if (dups.size() > 0)
+ //{
+ // throw new IllegalArgumentException("Cannot add DetectorElement <"
+ // + de.getName() + "> because its identifier <"+id
+ // +"> is already used by <"+dups.get(0).getName()+">.");
+ //}
// Cache this DE in the lookup map.
cache.put(id.getValue(), de);
}
}
-
+
return true;
}