increased storage capacity of mock cdm cachers
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / taxon / Classification.java
index 815c5f65e5f2d5dd1947460bc24d87ad5f3af2f7..835f9820cfc4e99596c3045faf7db2bec1db2322 100644 (file)
@@ -261,7 +261,6 @@ public class Classification extends IdentifiableEntity<IIdentifiableEntityCacheS
             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
@@ -315,8 +314,12 @@ public class Classification extends IdentifiableEntity<IIdentifiableEntityCacheS
         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
@@ -402,7 +405,7 @@ public class Classification extends IdentifiableEntity<IIdentifiableEntityCacheS
                     }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
@@ -411,7 +414,6 @@ public class Classification extends IdentifiableEntity<IIdentifiableEntityCacheS
                     }\r
                 }else{\r
                     this.makeTopmostNodeChildOfOtherNode(childNode, parentNode, citation, microCitation);\r
-\r
                 }\r
             }\r
             return childNode;\r
@@ -462,10 +464,6 @@ public class Classification extends IdentifiableEntity<IIdentifiableEntityCacheS
         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