Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/src/org/sbml/jsbml/AbstractTreeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ public AbstractTreeNode(TreeNode node) {
AbstractTreeNode anode = (AbstractTreeNode) node;
// Do not clone listeners!
// this.listOfListeners.addAll(anode.listOfListeners);
if (anode.isSetUserObjects()) {
userObjects = new HashMap<Object, Object>();
userObjects.putAll(anode.userObjects);
// Copy userObjects if present. We must not rely on isSetUserObjects(),
// because subclasses may override it with different semantics.
if (anode.userObjects != null && !anode.userObjects.isEmpty()) {
userObjects = new HashMap<Object, Object>(anode.userObjects);
}

// TODO - add this for all objects when we start using the checkAttribute method for other classes than Compartment.
Expand Down