/** * Creates a new {@link InvocationTreeElement} which is related to the given parent and contains * the given data objet. * * @param dataElement * the data element of the created {@link InvocationTreeElement} * @param parent * the parent element * @return the newly created {@link InvocationTreeElement} */ private InvocationTreeElement createTreeElement(Object dataElement, InvocationTreeElement parent) { InvocationTreeElement element = new InvocationTreeElement(dataElement); if (parent != null) { parent.addChild(element); } if (dataElement instanceof Span) { Span span = (Span) dataElement; // put the span into the `spansExistingInTree` map in order to mark that it is existing // in the tree, now spansExistingInTree.put(span.getSpanIdent().getId(), element); } return element; }
newRoot.addChild(parent);