Fixes #2235
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / name / container / ContainerFactory.java
index 7672265680a8d913ee33d2ec737cb767c6c1f409..1634b7dcc860ac92238988c8800e382237447ca6 100644 (file)
@@ -43,8 +43,13 @@ public class ContainerFactory {
                        TaxonNameEditor taxonNameEditor) {
                List<HomotypicalSynonymGroup> retainedGroups = new ArrayList<HomotypicalSynonymGroup>();
                
-               for(HomotypicalSynonymGroup group : taxonNameEditor.getHeterotypicSynonymGroups()){
-                       retainedGroups.add(group);
+               List<HomotypicalSynonymGroup> heterotypicSynonymGroups = taxonNameEditor.getHeterotypicSynonymGroups();
+               
+               if (heterotypicSynonymGroups != null) {
+               
+                       for(HomotypicalSynonymGroup group : heterotypicSynonymGroups){
+                               retainedGroups.add(group);
+                       }
                }
                
                for(HomotypicalGroup homotypicalGroup : taxonNameEditor.getTaxon().getHeterotypicSynonymyGroups()){
@@ -96,23 +101,4 @@ public class ContainerFactory {
                
        }
 
-       /**
-        * @param taxonNameEditor
-        */
-       public static void createOrUpdateConceptGroup(
-                       TaxonNameEditor taxonNameEditor) {
-               Set<TaxonRelationship> filteredTaxonRelations = new HashSet<TaxonRelationship>();
-               
-               for (TaxonRelationship relationship : taxonNameEditor.getTaxon().getTaxonRelations()) {
-                       if (! relationship.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR()) ||
-                                        relationship.getType().equals(TaxonRelationshipType.TAXONOMICALLY_INCLUDED_IN())) {
-                               filteredTaxonRelations.add(relationship);
-                       }
-               }
-               
-               if(! filteredTaxonRelations.isEmpty()){
-                       taxonNameEditor.setConceptGroup(new ConceptGroup(taxonNameEditor));
-               }
-       }
-
 }