git://wamblee.org
/
xmlrouter
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checking non-null in compositeconfig.
[xmlrouter]
/
impl
/
src
/
main
/
java
/
org
/
wamblee
/
xmlrouter
/
impl
/
ConfigImpl.java
diff --git
a/impl/src/main/java/org/wamblee/xmlrouter/impl/ConfigImpl.java
b/impl/src/main/java/org/wamblee/xmlrouter/impl/ConfigImpl.java
index 9442db674eb027575182da4f9675badbe76e07f4..0324e78f8353b1dd58598e49b66ecca786b6552d 100644
(file)
--- a/
impl/src/main/java/org/wamblee/xmlrouter/impl/ConfigImpl.java
+++ b/
impl/src/main/java/org/wamblee/xmlrouter/impl/ConfigImpl.java
@@
-15,6
+15,8
@@
*/
package org.wamblee.xmlrouter.impl;
*/
package org.wamblee.xmlrouter.impl;
+import static org.wamblee.xmlrouter.impl.MessageUtil.*;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@
-36,7
+38,7
@@
import org.wamblee.xmlrouter.config.Identifiable;
*/
// TODO make sure that each item inside this config is prefixed with the id of
// the config.
*/
// TODO make sure that each item inside this config is prefixed with the id of
// the config.
-public abstract class ConfigImpl<T extends Identifiable> implements
+public abstract class ConfigImpl<T extends Identifiable
<T>
> implements
ExtendedConfig<T> {
private Id<Config> id;
ExtendedConfig<T> {
private Id<Config> id;
@@
-63,8
+65,7
@@
public abstract class ConfigImpl<T extends Identifiable> implements
*/
@Override
public synchronized void add(T aT) {
*/
@Override
public synchronized void add(T aT) {
- // TODO test duplicate ids.
- notNull(aT);
+ notNull("aT", aT);
registered.add(wrap(id.getId() + ".", aT));
}
registered.add(wrap(id.getId() + ".", aT));
}
@@
-86,7
+87,7
@@
public abstract class ConfigImpl<T extends Identifiable> implements
*/
@Override
public synchronized boolean remove(Id<T> aId) {
*/
@Override
public synchronized boolean remove(Id<T> aId) {
- notNull(aId);
+ notNull(
"aId",
aId);
Iterator<T> i = registered.iterator();
while (i.hasNext()) {
T t = i.next();
Iterator<T> i = registered.iterator();
while (i.hasNext()) {
T t = i.next();
@@
-102,16
+103,4
@@
public abstract class ConfigImpl<T extends Identifiable> implements
public List<T> values() {
return Collections.unmodifiableList(registered);
}
public List<T> values() {
return Collections.unmodifiableList(registered);
}
-
- private void notNull(T aT) {
- if (aT == null) {
- throw new NullPointerException("Object is null");
- }
- }
-
- private void notNull(Id<T> aId) {
- if (aId == null) {
- throw new NullPointerException("Id is null");
- }
- }
}
}