checking non-null in compositeconfig.
authorErik Brakkee <erik@brakkee.org>
Sun, 7 Aug 2011 20:09:29 +0000 (22:09 +0200)
committerErik Brakkee <erik@brakkee.org>
Sun, 7 Aug 2011 20:09:29 +0000 (22:09 +0200)
impl/src/main/java/org/wamblee/xmlrouter/impl/CompositeConfig.java

index 22052108f5dd780c5eaffc3eb23f0e90bddafca0..2523ef8d652b76752251f340c05e60b88ceca7a4 100644 (file)
@@ -44,6 +44,7 @@ public class CompositeConfig<T extends Identifiable<T>> implements
     private List<T> values;
 
     public CompositeConfig(Id<Config> aId) {
+        notNull("aId", aId);
         ids = new HashSet<Id<Config>>();
         id = aId;
         valueIds = new ArrayList<Id<T>>();
@@ -56,6 +57,7 @@ public class CompositeConfig<T extends Identifiable<T>> implements
     }
 
     public void addConfig(Config<T> aConfig) {
+        notNull("aConfig", aConfig);
         if (ids.contains(aConfig.getId())) {
             throw new DuplicateException(aConfig.getId().toString());
         }