Config no longer implements Identifiable because this was in violation of the contrac...
[xmlrouter] / impl / src / main / java / org / wamblee / xmlrouter / impl / RobustIdentifiable.java
index d5ba9f95bf18a2691103e6336d20a4c97e76c12a..f371975fac804c378162084bc0e1a74536fbe2d9 100644 (file)
@@ -21,7 +21,6 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.wamblee.xmlrouter.common.Id;
-import org.wamblee.xmlrouter.config.ConfigException;
 import org.wamblee.xmlrouter.config.Identifiable;
 
 /**
@@ -38,15 +37,13 @@ public class RobustIdentifiable<T> implements Identifiable<T> {
 
     private Id<T> id;
 
-    public RobustIdentifiable(String aPrefix, Identifiable<T> aIdentifiable) {
-        notNull("prefix", aPrefix);
+    public RobustIdentifiable(Identifiable<T> aIdentifiable) {
         notNull("identifiable", aIdentifiable);
         try {
             id = aIdentifiable.getId();
             if (id == null) {
                 throwConfigException("identifiable.getId() returned null", null);
             }
-            id = new Id<T>(aPrefix + id.getId());
         } catch (Exception e) {
             throwConfigException("identifiable.getId() threw exception", e);
         }
@@ -55,7 +52,7 @@ public class RobustIdentifiable<T> implements Identifiable<T> {
 
     private void throwConfigException(String aMsg, Exception aException) {
         LOGGER.log(Level.WARNING, aMsg, aException);
-        throw new ConfigException("id is null");
+        throw new ConfigException(aMsg);
     }
 
     @Override
@@ -63,8 +60,6 @@ public class RobustIdentifiable<T> implements Identifiable<T> {
         return id;
     }
 
-    // TODO test equals, hashcode.
-
     @Override
     public int hashCode() {
         return id.hashCode();