git://wamblee.org
/
xmlrouter
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed the prefix argument from ConfigImpl.wrap().
[xmlrouter]
/
impl
/
src
/
main
/
java
/
org
/
wamblee
/
xmlrouter
/
impl
/
RobustIdentifiable.java
diff --git
a/impl/src/main/java/org/wamblee/xmlrouter/impl/RobustIdentifiable.java
b/impl/src/main/java/org/wamblee/xmlrouter/impl/RobustIdentifiable.java
index 6622e3277a85e35ae2dbf527bac761ae07f1d3e9..2e63a9799901f2616e6fdc6fc1438c80adf570a1 100644
(file)
--- a/
impl/src/main/java/org/wamblee/xmlrouter/impl/RobustIdentifiable.java
+++ b/
impl/src/main/java/org/wamblee/xmlrouter/impl/RobustIdentifiable.java
@@
-25,7
+25,8
@@
import org.wamblee.xmlrouter.config.ConfigException;
import org.wamblee.xmlrouter.config.Identifiable;
/**
import org.wamblee.xmlrouter.config.Identifiable;
/**
- * Robust identifiable provides robustness for identifiable objects.
+ * Robust identifiable provides robustness for identifiable objects. It adds
+ * equality based on the id.
*
* @author Erik Brakkee
*
*
* @author Erik Brakkee
*
@@
-37,20
+38,13
@@
public class RobustIdentifiable<T> implements Identifiable<T> {
private Id<T> id;
private Id<T> id;
- // TODO test this class.
- // TODO test that id is constant even though delegated changes its id.
-
- public RobustIdentifiable(String aPrefix, Identifiable<T> aIdentifiable) {
- notNull("prefix", aPrefix);
+ public RobustIdentifiable(Identifiable<T> aIdentifiable) {
notNull("identifiable", aIdentifiable);
notNull("identifiable", aIdentifiable);
- // TODO test id is null
- // TODO getId() throws exception
try {
id = aIdentifiable.getId();
if (id == null) {
throwConfigException("identifiable.getId() returned null", null);
}
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);
}
} catch (Exception e) {
throwConfigException("identifiable.getId() threw exception", e);
}
@@
-59,7
+53,7
@@
public class RobustIdentifiable<T> implements Identifiable<T> {
private void throwConfigException(String aMsg, Exception aException) {
LOGGER.log(Level.WARNING, aMsg, aException);
private void throwConfigException(String aMsg, Exception aException) {
LOGGER.log(Level.WARNING, aMsg, aException);
- throw new ConfigException(
"id is null"
);
+ throw new ConfigException(
aMsg
);
}
@Override
}
@Override
@@
-67,8
+61,6
@@
public class RobustIdentifiable<T> implements Identifiable<T> {
return id;
}
return id;
}
- // TODO test equals, hashcode.
-
@Override
public int hashCode() {
return id.hashCode();
@Override
public int hashCode() {
return id.hashCode();