fix for #5638
authorKatja Luther <k.luther@bgbm.org>
Wed, 18 May 2016 10:41:15 +0000 (12:41 +0200)
committerKatja Luther <k.luther@bgbm.org>
Wed, 18 May 2016 10:41:15 +0000 (12:41 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/ProtologueSection.java

index 8f444705eb0f195a1c0f5fed1a1cd44b2eb628c6..05a117bd660c5eb14c1aea07f11f0b78e2e2ac2b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -36,7 +36,7 @@ import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
  * @version 1.0
  */
 public class ProtologueSection extends AbstractEntityCollectionSection<TaxonNameBase, DescriptionElementBase> implements ITaxonBaseDetailSection{
-       
+
        private TaxonBase taxonBase;
 
        /**
@@ -97,16 +97,17 @@ public class ProtologueSection extends AbstractEntityCollectionSection<TaxonName
                List<TaxonNameDescription> descriptions = getTaxonNameDescriptions(getEntity());
                for (TaxonNameDescription desc : descriptions){
                        desc.removeElement(element);
-               } 
+               }
        }
 
        /** {@inheritDoc} */
-       public void setTaxonBase(TaxonBase entity) {
+       @Override
+    public void setTaxonBase(TaxonBase entity) {
                this.taxonBase = entity;
-               NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName(), NonViralName.class);
+               NonViralName name = HibernateProxyHelper.deproxy(entity.getName(), NonViralName.class);
                setEntity(name);
        }
-       
+
        /**
         * NOTE: returns first description
         * @param name
@@ -118,7 +119,7 @@ public class ProtologueSection extends AbstractEntityCollectionSection<TaxonName
                }
                return (TaxonNameDescription) name.getDescriptions().iterator().next();
        }
-       
+
        /**
         * Try to fix FIXME in {@link #getTaxonNameDescription(TaxonNameBase)}
         * @param name
@@ -129,9 +130,9 @@ public class ProtologueSection extends AbstractEntityCollectionSection<TaxonName
                if (name == null){
                        return result;
                }
-               if(name.getDescriptions().size() == 0){
-                       name.addDescription(TaxonNameDescription.NewInstance(name));
-               }
+//             if(name.getDescriptions().size() == 0){
+//                     name.addDescription(TaxonNameDescription.NewInstance(name));
+//             }
                for (TaxonNameDescription desc : name.getDescriptions()){
                        result.add(desc);
                }