- @SuppressWarnings("unchecked")
- protected void appendChildren(Map<String, ?> children) {
- synchronized(this.children) {
- for(String id : children.keySet()) {
- INode child = (INode)children.get(id);
- this.children.put(id, (T)child); // Hopefully cast works
- child.setParent(this);
-
- // Send notify only if we are on server side (or standalone)
- if (propertyChangeListener != null && location.equals(Location.LOCAL)) {
- propertyChangeListener.propertyChange(new PropertyChangeEvent(this, "children["+child.getId()+"]", null, EXISTING)); // "children" is a special field name
- }
- }
- }
+ protected void appendChildren(Map<String, INode> children) {
+ children.forEach((key, value) -> {
+ appendChildInternal(key, value);
+ });