DTree (@NotNull DiffElement element, boolean source, String replacementName) { init(); myChildrenList = null; final DTree node; final String name = element.getName(); if (replacementName != null && myChildren.containsKey(replacementName)) { node = myChildren.get(replacementName); } else if (myChildren.containsKey(name)) { node = myChildren.get(name); } else { node = new DTree(this, element.getPresentableName(), element.isContainer()); myChildren.put(name, node); } if (source) { node.setSource(element); } else { node.setTarget(element); } return node; }