git://wamblee.org
/
xmlrouter
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
now making sure that ids re prefixed by the config id.
[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 f3da5f401e98f0dd7ae252c8c04458c781a51ad9..640e37e13385402e9414c6beb2719bb3d6e2d378 100644
(file)
--- a/
impl/src/main/java/org/wamblee/xmlrouter/impl/RobustIdentifiable.java
+++ b/
impl/src/main/java/org/wamblee/xmlrouter/impl/RobustIdentifiable.java
@@
-37,15
+37,16
@@
public class RobustIdentifiable<T> implements Identifiable<T> {
// TODO test this class.
// TODO test that id is constant even though delegated changes its id.
// TODO test this class.
// TODO test that id is constant even though delegated changes its id.
- public RobustIdentifiable(Identifiable<T> aIdentifiable) {
+ public RobustIdentifiable(
String aPrefix,
Identifiable<T> aIdentifiable) {
// TODO test id is null
// TODO getId() throws exception
try {
id = aIdentifiable.getId();
if (id == null) {
id = new Id<T>(Constants.UNKNOWN_ID.toString());
// TODO test id is null
// TODO getId() throws exception
try {
id = aIdentifiable.getId();
if (id == null) {
id = new Id<T>(Constants.UNKNOWN_ID.toString());
- throw new RuntimeException(
- "Temporary to catch nulls during refactoring");
+ temporarilyThrowException();
+ } else {
+ id = new Id<T>(aPrefix + id.getId());
}
} catch (Exception e) {
LOGGER
}
} catch (Exception e) {
LOGGER
@@
-54,6
+55,11
@@
public class RobustIdentifiable<T> implements Identifiable<T> {
}
}
+ private void temporarilyThrowException() {
+ throw new RuntimeException(
+ "Temporary to catch nulls during refactoring");
+ }
+
@Override
public Id<T> getId() {
return id;
@Override
public Id<T> getId() {
return id;