commit 87272062b8bca6cf687cd7b5350d74e3410aba0b
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Wed Apr 13 08:25:53 2016 +0200

    Fix taxon node creation for nodes with no parents

diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java
index c45cb43f..ef016cb8 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListGefaesspflanzenImportClassification.java
@@ -117,16 +117,20 @@ public class RedListGefaesspflanzenImportClassification extends DbImportBase<Red
         if(taxonBaseCL!=null){//null check necessary because not all taxa exist in the checklist
             createParentChildNodes(checklistClassification, id, gueltString, taxZusatzString, taxonBaseCL, parentCL);
         }
+
+        if(taxonBaseGL!= null && taxonBaseCL!=null
+                && taxonBaseGL.getUuid().equals(taxonBaseCL.getUuid())){
+            RedListUtil.logMessage(id, "Same UUID for "+taxonBaseGL+ " (Gesamtliste) and "+taxonBaseCL+" (Checkliste", logger);
+        }
+        if(parentGL!=null && parentCL!=null && parentGL.getUuid().equals(parentCL.getUuid())){
+            RedListUtil.logMessage(id, "Same UUID for "+parentGL+ " (Gesamtliste) and "+parentCL+" (Checkliste", logger);
+        }
     }
 
     private void createParentChildNodes(Classification classification, long id, String gueltString,
             String taxZusatzString, TaxonBase taxonBase, Taxon parent) {
-        if(parent==null){
-            RedListUtil.logMessage(id, "parent taxon of "+taxonBase+"  is null." , logger);
-            return;
-        }
         if(taxonBase==null){
-            RedListUtil.logMessage(id, "child taxon/synonym of "+parent+"  is null." , logger);
+            RedListUtil.logMessage(id, "child taxon/synonym of "+parent+"  is null. ("+classification.getTitleCache()+")" , logger);
             return;
         }
         //taxon
@@ -134,6 +138,10 @@ public class RedListGefaesspflanzenImportClassification extends DbImportBase<Red
             //misapplied name
             String appendedPhrase = taxonBase.getAppendedPhrase();
             if(appendedPhrase!=null && appendedPhrase.equals(RedListUtil.AUCT)){
+                if(parent==null){
+                    RedListUtil.logMessage(id, "parent taxon of misapplied name "+taxonBase+"  is null. ("+classification.getTitleCache()+")" , logger);
+                    return;
+                }
                 parent.addMisappliedName((Taxon) taxonBase, null, null);
             }
             else{
@@ -148,6 +156,10 @@ public class RedListGefaesspflanzenImportClassification extends DbImportBase<Red
         }
         //synonym
         else if(taxonBase.isInstanceOf(Synonym.class)){
+            if(parent==null){
+                RedListUtil.logMessage(id, "parent taxon of synonym "+taxonBase+"  is null. ("+classification.getTitleCache()+")" , logger);
+                return;
+            }
             //basionym
             if(gueltString.equals(RedListUtil.GUELT_BASIONYM)){
                 parent.addHomotypicSynonym((Synonym) taxonBase, null, null);
@@ -182,6 +194,7 @@ public class RedListGefaesspflanzenImportClassification extends DbImportBase<Red
         }
         //set sec reference
         taxonBase.setSec(classification.getReference());
+        taxonBase.setTitleCache(null, false);//refresh title cache
     }
 
     @Override
@@ -219,8 +232,8 @@ public class RedListGefaesspflanzenImportClassification extends DbImportBase<Red
         Classification checklistClassification = Classification.NewInstance("Checkliste");
         checklistClassification.setUuid(RedListUtil.checkListClassificationUuid);
         Reference checklistReference = ReferenceFactory.newGeneric();
-        checklistReference.setUuid(RedListUtil.checkListClassificationUuid);
-        checklistReference.setTitle("Gesamtliste");
+        checklistReference.setUuid(RedListUtil.checkListReferenceUuid);
+        checklistReference.setTitle("Checkliste");
         checklistClassification.setReference(checklistReference);
         getClassificationService().save(checklistClassification);
     }
diff --git a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListUtil.java b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListUtil.java
index 530a62d2..412e8049 100644
--- a/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListUtil.java
+++ b/app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/gefaesspflanzen/RedListUtil.java
@@ -34,28 +34,21 @@ public class RedListUtil {
 //    public static final UUID checkListClassificationUuid = UUID.fromString("e19bb2e6-d898-4793-8cd4-d866eeb1f872");
 //    public static final UUID checkListClassificationUuid = UUID.fromString("53e81162-5c2d-425b-bbe6-6e8d12e85790");
 
-
-
-
-
-
-
-
-
-
-
     public static final String NAME_NAMESPACE = "name";
     public static final String TAXON_GESAMTLISTE_NAMESPACE = "taxon_gesamt_liste";
     public static final String TAXON_CHECKLISTE_NAMESPACE = "taxon_checkliste";
     public static final String AUTHOR_NAMESPACE = "author";
 
+
+    //cell content
+    public static final String HYBRID_CHAR = "";
     public static final String AUCT = "auct.";
     public static final String EX = " ex ";
     public static final String GUELT_BASIONYM = "b";
     public static final String GUELT_SYNONYM = "x";
     public static final String GUELT_ACCEPTED_TAXON = "1";
 
-
+    //column names
     public static final String GUELT = "GUELT";
     public static final String LOWER = "LOWER";
     public static final String NAMNR = "NAMNR";
