* Throw exception instead of removing the old node when adding
a node to a named collection with a name that is already taken. Fixes bug 568 <http://helma.org/bugs/show_bug.cgi?id=568>
This commit is contained in:
parent
ac4e78cb17
commit
5cd2021502
1 changed files with 2 additions and 2 deletions
|
@ -2063,8 +2063,8 @@ public final class Node implements INode, Serializable {
|
||||||
INode n = (INode) parent.getChildElement(value);
|
INode n = (INode) parent.getChildElement(value);
|
||||||
|
|
||||||
if ((n != null) && (n != this)) {
|
if ((n != null) && (n != this)) {
|
||||||
parent.unset(value);
|
throw new RuntimeException(this +
|
||||||
parent.removeNode(n);
|
" already contains an object named " + value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if this node is already registered with the old name;
|
// check if this node is already registered with the old name;
|
||||||
|
|
Loading…
Add table
Reference in a new issue