throw new IllegalArgumentException("root node and other node must not be the same");\r
}\r
otherNode.addChildNode(topmostNode, ref, microReference);\r
- //getRootNodes().remove(root);\r
}\r
\r
\r
for (TaxonNode taxonNode: taxon.getTaxonNodes()){\r
if (taxonNode.getClassification().equals(this)){\r
if (this.getChildNodes().contains(taxonNode)){\r
- if (taxonNode.getParent() != null){\r
- logger.warn("A topmost node should have no parent but actually has a parent");\r
+ if (taxonNode.getParent() == null){\r
+ logger.warn("A topmost node should always have the root node as parent but actually has no parent");\r
+ }else if (taxonNode.getParent().getParent() != null){\r
+ logger.warn("The root node should have not parent but actually has one");\r
+ }else if (taxonNode.getParent().getTaxon() != null){\r
+ logger.warn("The root node should have not taxon but actually has one");\r
}\r
return taxonNode;\r
}\r
}else{\r
logger.warn("ChildNode has no classification: " + childNode.getId());\r
}\r
- parentNode.addChildNode(childNode, citation, microCitation);\r
+ parentNode.addChildNode(childNode, citation, microCitation);\r
if (!parentNode.isTopmostNode()){\r
this.addChildNode(parentNode, citation, microCitation);\r
logger.warn("parent is added as a topmost node");\r
}\r
}else{\r
this.makeTopmostNodeChildOfOtherNode(childNode, parentNode, citation, microCitation);\r
-\r
}\r
}\r
return childNode;\r
return rootNode.getChildNodes();\r
}\r
\r
- private void setRootNodes(List<TaxonNode> rootNodes) {\r
- this.rootNode.setChildNodes(rootNodes);\r
- }\r
-\r
@Override\r
public Reference getReference() {\r
return reference;\r