cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 2 Feb 2017 13:55:15 +0000 (14:55 +0100)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 2 Feb 2017 13:55:33 +0000 (14:55 +0100)
24 files changed:
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/TeamOrPersonBase.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonNameComparator.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/TaxonNodeByNameComparator.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/view/context/GlobalAuditEventContextHolderStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/view/context/InheritableThreadLocalAuditEventContextHolderStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/view/context/ThreadLocalAuditEventContextHolderStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/HTMLTagRules.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/agent/InstitutionDefaultCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/common/IdentifiableEntityDefaultCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/common/TermDefaultCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/description/SpecimenDescriptionDefaultCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/description/TaxonDescriptionDefaultCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/media/MediaDefaultCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/name/BotanicNameDefaultCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseShortSecCacheStrategy.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/generate/PolytomousKeyGenerator.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/match/MatchStrategyConfigurator.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/match/Matching.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NameTypeParser.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/SpecimenTypeParser.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/TaxonNameParserHistory.java [deleted file]
cdmlib-model/src/main/java/eu/etaxonomy/cdm/validation/constraint/TaxonNameCannotBeAcceptedAndSynonymValidator.java
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/validation/Address.java
cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/test/suite/TestsShouldNotFailInSuite_2.java

index 4fee36b63e75cba0f68b55ee6f4ccff0ad70c109..7e0b01d6fda590618102385d5d20e4473ad4560f 100644 (file)
@@ -31,7 +31,6 @@ import eu.etaxonomy.cdm.strategy.cache.agent.INomenclaturalAuthorCacheStrategy;
  * for authorship of {@link eu.etaxonomy.cdm.model.reference.Reference references} or of {@link eu.etaxonomy.cdm.model.name.TaxonNameBase taxon names}.
  *
  * @author a.mueller
- * @version 1.0
  * @created 17-APR-2008
  */
 @XmlAccessorType(XmlAccessType.FIELD)
index f7b4cf34c948bacfc07f6f403b4b069f9464c680..22fb1dcdfcf2c673d62ca3cef0ff1266a20c25ef 100644 (file)
@@ -6,21 +6,22 @@ import java.util.Comparator;
 public class TaxonNameComparator implements Comparator<TaxonNameBase>, Serializable {\r
        private static final long serialVersionUID = -1007495803322700031L;\r
 \r
-       public int compare(TaxonNameBase arg0, TaxonNameBase arg1) {\r
+       @Override\r
+    public int compare(TaxonNameBase arg0, TaxonNameBase arg1) {\r
                if (arg0.equals(arg1)){\r
                        return 0;\r
                }\r
-               \r
+\r
                String nameCacheOfArg0 = arg0.getTitleCache();\r
                String nameCacheOfArg1 = arg1.getTitleCache();\r
-                       \r
+\r
                int result = nameCacheOfArg0.compareToIgnoreCase(nameCacheOfArg1);\r
                if (result != 0){\r
                        return result;\r
                }else{\r
                        return arg0.getUuid().compareTo(arg1.getUuid());\r
                }\r
-               \r
+\r
        }\r
 \r
 }
index ae403d4e0490117a123b2788994cdf6fe16f56dc..73fba3d1d061311676a35d38b42f22001f36f102 100644 (file)
@@ -24,7 +24,6 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
  * @date 24.06.2009\r
  *\r
  */\r
-//@Component\r
 public class TaxonNodeByNameComparator extends AbstractStringComparator<TaxonNode> implements Comparator<TaxonNode>, ITaxonNodeComparator<TaxonNode> {\r
 \r
     private static final String HYBRID_SIGN = "\u00D7";\r
index 3dbb96d5bd4b93108e59eabeff54383dd2ebf9b9..11929a68270b52707358557453f4fb3c8b042bdd 100644 (file)
@@ -5,29 +5,31 @@
 *
 * 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.
-*/ 
+*/
 
 package eu.etaxonomy.cdm.model.view.context;
 
 import org.springframework.util.Assert;
 /**
- * Class based heavily on GlobalSecurityContextHolderStrategy, part 
- * of spring-security, but instead binding a View object to the 
- * context. 
- * 
+ * Class based heavily on GlobalSecurityContextHolderStrategy, part
+ * of spring-security, but instead binding a View object to the
+ * context.
+ *
  * @author ben
  *
  */
 public class GlobalAuditEventContextHolderStrategy implements
                AuditEventContextHolderStrategy {
-       
+
        private static AuditEventContext contextHolder;
 
-       public void clearContext() {
+       @Override
+    public void clearContext() {
                contextHolder = null;
        }
 
-       public AuditEventContext getContext() {
+       @Override
+    public AuditEventContext getContext() {
                if (contextHolder == null) {
             contextHolder = new AuditEventContextImpl();
         }
@@ -35,7 +37,8 @@ public class GlobalAuditEventContextHolderStrategy implements
         return contextHolder;
        }
 
-       public void setContext(AuditEventContext context) {
+       @Override
+    public void setContext(AuditEventContext context) {
                Assert.notNull(context, "Only non-null AuditEventContext instances are permitted");
         contextHolder = context;
        }
index e5fb7da973a0d0367f1d1871d59cdbeb3c0652e5..41203d4eb3bc863a49336ba5ac2ede0f5d07e199 100644 (file)
@@ -5,39 +5,42 @@
 *
 * 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.
-*/ 
+*/
 
 package eu.etaxonomy.cdm.model.view.context;
 
 import org.springframework.util.Assert;
 
 /**
- * Class based heavily on InheritableThreadLocalSecurityContextHolderStrategy, part 
- * of spring-security, but instead binding a View object to the 
+ * Class based heavily on InheritableThreadLocalSecurityContextHolderStrategy, part
+ * of spring-security, but instead binding a View object to the
  * context.
- * 
+ *
  * @author ben
  * @author Ben Alex
  *
  */
 public class InheritableThreadLocalAuditEventContextHolderStrategy implements
                AuditEventContextHolderStrategy {
-       
-       private static ThreadLocal contextHolder = new InheritableThreadLocal();
 
-       public void clearContext() {
+       private static ThreadLocal<AuditEventContext> contextHolder = new InheritableThreadLocal<AuditEventContext>();
+
+       @Override
+    public void clearContext() {
                contextHolder.set(null);
        }
 
-       public AuditEventContext getContext() {
+       @Override
+    public AuditEventContext getContext() {
                if (contextHolder.get() == null) {
             contextHolder.set(new AuditEventContextImpl());
         }
 
-        return (AuditEventContext) contextHolder.get();
+        return contextHolder.get();
        }
 
-       public void setContext(AuditEventContext context) {
+       @Override
+    public void setContext(AuditEventContext context) {
                Assert.notNull(context, "Only non-null AuditEventContext instances are permitted");
         contextHolder.set(context);
        }
index 5ab6987a5f4162d357efa73c0a09d8323ec5b982..b6c5f91f7da9d6d6d54ee2cfc3e952e1f613f81e 100644 (file)
@@ -5,17 +5,17 @@
 *
 * 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.
-*/ 
+*/
 
 package eu.etaxonomy.cdm.model.view.context;
 
 import org.springframework.util.Assert;
 
 /**
- * Class based heavily on ThreadLocalSecurityContextHolderStrategy, part 
- * of spring-security, but instead binding a View object to the 
+ * Class based heavily on ThreadLocalSecurityContextHolderStrategy, part
+ * of spring-security, but instead binding a View object to the
  * context.
- * 
+ *
  * @author ben
  * @author Ben Alex
  *
@@ -24,20 +24,23 @@ public class ThreadLocalAuditEventContextHolderStrategy implements
                AuditEventContextHolderStrategy {
 
        private static ThreadLocal contextHolder = new ThreadLocal();
-       
-       public void clearContext() {
+
+       @Override
+    public void clearContext() {
                contextHolder.set(null);
        }
 
-       public AuditEventContext getContext() {
+       @Override
+    public AuditEventContext getContext() {
                if (contextHolder.get() == null) {
             contextHolder.set(new AuditEventContextImpl());
         }
-               
+
                return (AuditEventContext) contextHolder.get();
        }
 
-       public void setContext(AuditEventContext context) {
+       @Override
+    public void setContext(AuditEventContext context) {
                Assert.notNull(context, "Only non-null AuditEventContext instances are permitted");
         contextHolder.set(context);
        }
index f999e6c72233df4fd028078382bce57c81b80480..1c0af2dce0091752c25fcae8ad46d61f8d0ae2c6 100644 (file)
@@ -1,5 +1,5 @@
 /**\r
- * \r
+ *\r
  */\r
 package eu.etaxonomy.cdm.strategy.cache;\r
 \r
@@ -10,7 +10,7 @@ import java.util.TreeSet;
 \r
 /**\r
  * Rules to define tagging for HTML tagged string output.\r
- * \r
+ *\r
  * @author a.mueller\r
  * @created 14/02/2012\r
  *\r
@@ -18,7 +18,7 @@ import java.util.TreeSet;
 public class HTMLTagRules {\r
 \r
        private List<TagRule> rules = new ArrayList<HTMLTagRules.TagRule>();\r
-       \r
+\r
        private class TagRule{\r
                private TagRule(TagEnum type, String htmlTag){this.type = type; this.htmlTag = htmlTag;}\r
                private TagEnum type;\r
@@ -27,8 +27,8 @@ public class HTMLTagRules {
 //             public String getString(){return this.htmlTag;}\r
                @Override public String toString(){return type.name() + "-><" + htmlTag + ">";}\r
        }\r
-       \r
-       \r
+\r
+\r
        public HTMLTagRules addRule(TagEnum type, String htmlTag){\r
                if (type == null || htmlTag == null){\r
                        throw new NullPointerException("Null tpye or htmlTag not allowed for HTMLTagRule");\r
@@ -36,7 +36,7 @@ public class HTMLTagRules {
                rules.add(new TagRule(type, htmlTag));\r
                return this;\r
        }\r
-       \r
+\r
        public SortedSet<String> getRule(TagEnum type){\r
                SortedSet<String> result = new TreeSet<String>();\r
                for (TagRule rule : rules){\r
@@ -46,7 +46,7 @@ public class HTMLTagRules {
                }\r
                return result;\r
        }\r
-       \r
+\r
        public boolean hasRule(TagEnum type, String htmlTag){\r
                for (TagRule rule : rules){\r
                        if (rule.type.equals(type) && htmlTag.equals(htmlTag)){\r
@@ -55,7 +55,7 @@ public class HTMLTagRules {
                }\r
                return false;\r
        }\r
-       \r
+\r
        @Override\r
        public String toString(){\r
                String result = "HTMLTagRules[";\r
@@ -65,6 +65,6 @@ public class HTMLTagRules {
                result = result.substring(0, result.length() -1) + "]";\r
                return result;\r
        }\r
-       \r
-       \r
+\r
+\r
 }\r
index 1fe65950abc1efbc61a0e9332b0d957a151a10bd..4fd3993c449dfdff6a0b2a4cb0a16cdd8501a60b 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -21,7 +21,7 @@ import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
 /**\r
  * A default cache strategy for institutions.\r
  * TODO This is a preliminary implementation to have at least one default cache strategy.\r
- * Maybe it will need improvement later on. \r
+ * Maybe it will need improvement later on.\r
  * @author a.mueller\r
  * @date 07.04.2010\r
  *\r
@@ -30,10 +30,10 @@ public class InstitutionDefaultCacheStrategy extends StrategyBase implements IId
        private static final long serialVersionUID = 4586884860596045736L;\r
        @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(Collection.class);\r
-       \r
+\r
        public static UUID uuid = UUID.fromString("20a61a6f-aac9-422e-a95f-20dfacd35b65");\r
-       \r
-       \r
+\r
+\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.cdm.strategy.StrategyBase#getUuid()\r
         */\r
@@ -45,7 +45,8 @@ public class InstitutionDefaultCacheStrategy extends StrategyBase implements IId
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy#getTitleCache(eu.etaxonomy.cdm.model.common.IdentifiableEntity)\r
         */\r
-       public String getTitleCache(Institution institution) {\r
+       @Override\r
+    public String getTitleCache(Institution institution) {\r
                if (institution == null){\r
                        return null;\r
                }else{\r
index d290ddb83419a6fdcb5dc41f9fccb49e1485d11d..9533ee405ab0ec5dc9706ab51102d0a68ac5a52c 100644 (file)
@@ -5,7 +5,7 @@
 *\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
-*/ \r
+*/\r
 \r
 package eu.etaxonomy.cdm.strategy.cache.common;\r
 \r
@@ -17,12 +17,15 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.strategy.StrategyBase;\r
 \r
 public class IdentifiableEntityDefaultCacheStrategy<T extends IdentifiableEntity> extends StrategyBase implements IIdentifiableEntityCacheStrategy<T> {\r
-       @SuppressWarnings("unused")\r
+    private static final long serialVersionUID = -6358630407241112369L;\r
+\r
+    @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(IdentifiableEntityDefaultCacheStrategy.class);\r
 \r
        final static UUID uuid = UUID.fromString("85cbecb0-2020-11de-8c30-0800200c9a66");\r
-       \r
-       public String getTitleCache(T object) {\r
+\r
+       @Override\r
+    public String getTitleCache(T object) {\r
                return "-title cache generation not implemented-";\r
        }\r
 \r
index b11e6f3c476a8e0628890626f2f4853b4af755d8..80a6dd6e294d3cbea502c72039cded41c9862aa9 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -23,16 +23,13 @@ import eu.etaxonomy.cdm.model.common.TermBase;
  *\r
  */\r
 public class TermDefaultCacheStrategy<T extends TermBase> extends IdentifiableEntityDefaultCacheStrategy<T> implements IIdentifiableEntityCacheStrategy<T> {\r
-       /**\r
-        * \r
-        */\r
        private static final long serialVersionUID = 7687293307791110547L;\r
 \r
        @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(TermDefaultCacheStrategy.class);\r
-       \r
+\r
        final static UUID uuid = UUID.fromString("9cdf52c1-bac4-4b6c-a7f9-1a87401bd8f9");\r
-       \r
+\r
        @Override\r
        protected UUID getUuid() {\r
                return uuid;\r
index eabcb5f6100e660b2353cdb20f1c90a8952f8c88..9135f654c5c7ef27d1ac619da8a37f04eaf89d33 100644 (file)
@@ -5,7 +5,7 @@
 *\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
-*/ \r
+*/\r
 \r
 package eu.etaxonomy.cdm.strategy.cache.description;\r
 \r
@@ -21,17 +21,19 @@ import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
 \r
 public class SpecimenDescriptionDefaultCacheStrategy extends StrategyBase implements\r
                IIdentifiableEntityCacheStrategy<SpecimenDescription> {\r
+    private static final long serialVersionUID = 310092633142719872L;\r
+\r
+    final static UUID uuid = UUID.fromString("73c03fc4-0429-4ca1-b2cb-b9a56aad4d22");\r
 \r
-       final static UUID uuid = UUID.fromString("73c03fc4-0429-4ca1-b2cb-b9a56aad4d22");\r
-       \r
        @Override\r
        protected UUID getUuid() {\r
                return uuid;\r
        }\r
 \r
-       public String getTitleCache(SpecimenDescription specimenDescription) {\r
+       @Override\r
+    public String getTitleCache(SpecimenDescription specimenDescription) {\r
                String title;\r
-               SpecimenOrObservationBase specimen = specimenDescription.getDescribedSpecimenOrObservation(); \r
+               SpecimenOrObservationBase specimen = specimenDescription.getDescribedSpecimenOrObservation();\r
                if (specimen == null){\r
                        title = getFirstPart(specimenDescription);\r
                        title = title.replace(" for ", "");\r
@@ -41,7 +43,7 @@ public class SpecimenDescriptionDefaultCacheStrategy extends StrategyBase implem
                }\r
                return title;\r
        }\r
-       \r
+\r
        private String getFirstPart(SpecimenDescription specimenDescription){\r
                Set<Marker> markers = specimenDescription.getMarkers();\r
                MarkerType markerType = MarkerType.USE();\r
@@ -50,7 +52,7 @@ public class SpecimenDescriptionDefaultCacheStrategy extends StrategyBase implem
                        if(marker.getMarkerType().equals(markerType)) {\r
                                isUseDescription = true;\r
                        }\r
-               } \r
+               }\r
                if (specimenDescription.isImageGallery()){\r
                        return "Image gallery for " ;\r
                } else if (isUseDescription) {\r
index 9b55153be234823920b118fa2ab6a7581ee22825..b85b75f1178891a38fc61ff88d4f9d474732a94f 100644 (file)
@@ -5,7 +5,7 @@
 *\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
-*/ \r
+*/\r
 \r
 package eu.etaxonomy.cdm.strategy.cache.description;\r
 \r
@@ -23,15 +23,16 @@ public class TaxonDescriptionDefaultCacheStrategy extends StrategyBase implement
                IIdentifiableEntityCacheStrategy<TaxonDescription> {\r
 \r
        final static UUID uuid = UUID.fromString("0517ae48-597d-4d6b-9f18-8752d689720d");\r
-       \r
+\r
        @Override\r
        protected UUID getUuid() {\r
                return uuid;\r
        }\r
 \r
-       public String getTitleCache(TaxonDescription taxonDescription) {\r
+       @Override\r
+    public String getTitleCache(TaxonDescription taxonDescription) {\r
                String title;\r
-               Taxon taxon = taxonDescription.getTaxon(); \r
+               Taxon taxon = taxonDescription.getTaxon();\r
                if (taxon == null){\r
                        title = getFirstPart(taxonDescription);\r
                        title = title.replace(" for ", "");\r
@@ -45,7 +46,7 @@ public class TaxonDescriptionDefaultCacheStrategy extends StrategyBase implement
                }\r
                return title;\r
        }\r
-       \r
+\r
        private String getFirstPart(TaxonDescription taxonDescription){\r
                Set<Marker> markers = taxonDescription.getMarkers();\r
                MarkerType markerType = MarkerType.USE();\r
@@ -54,7 +55,7 @@ public class TaxonDescriptionDefaultCacheStrategy extends StrategyBase implement
                        if(marker.getMarkerType().equals(markerType)) {\r
                                isUseDescription = true;\r
                        }\r
-               } \r
+               }\r
                if (taxonDescription.isImageGallery()){\r
                        return "Image gallery for " ;\r
                } else if (isUseDescription) {\r
index 8c42f5fa4feef3f313cd3dfbe3abaffd76c77bb8..d365409a071fc62d07d8124959bb013c0ae4eeca 100644 (file)
@@ -27,7 +27,9 @@ import eu.etaxonomy.cdm.strategy.StrategyBase;
 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;\r
 \r
 public class MediaDefaultCacheStrategy extends StrategyBase implements IIdentifiableEntityCacheStrategy<Media> {\r
-       protected static final  Logger logger = Logger.getLogger(MediaDefaultCacheStrategy.class);\r
+    private static final long serialVersionUID = 7246846028810250751L;\r
+\r
+    protected static final  Logger logger = Logger.getLogger(MediaDefaultCacheStrategy.class);\r
 \r
        final static UUID uuid = UUID.fromString("0517ae48-597d-4d6b-9f18-8752d689720d");\r
 \r
index 55d4c31f5301e07956215ac147e8d8ae83d51e34..35549c8bef3285b9e4fc135c38aaf05c944e8031 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -27,21 +27,21 @@ public class BotanicNameDefaultCacheStrategy<T extends BotanicalName> extends No
        private static final long serialVersionUID = 2679554971446197111L;\r
 \r
        final static UUID uuid = UUID.fromString("1cdda0d1-d5bc-480f-bf08-40a510a2f223");\r
-       \r
+\r
        @Override\r
        public  UUID getUuid(){\r
                return uuid;\r
        }\r
 \r
-       \r
+\r
        public static BotanicNameDefaultCacheStrategy NewInstance(){\r
                return new BotanicNameDefaultCacheStrategy();\r
        }\r
-       \r
+\r
        /**\r
         * Returns the AuthorCache part for a combination of an author and an ex author. This applies on combination authors\r
         * as well as on basionym/orginal combination authors.\r
-        * The correct order is exAuthor ex author though some botanist do not know about and do it the \r
+        * The correct order is exAuthor ex author though some botanist do not know about and do it the\r
         * other way round. (see 46.4-46.6 ICBN (Vienna Code, 2006))\r
         * @param author the author\r
         * @param exAuthor the ex-author\r
@@ -52,7 +52,7 @@ public class BotanicNameDefaultCacheStrategy<T extends BotanicalName> extends No
                String result = "";\r
                String authorString = "";\r
                String exAuthorString = "";\r
-               \r
+\r
                if (author != null){\r
                        authorString = CdmUtils.Nz(author.getNomenclaturalTitle());\r
                }\r
@@ -60,10 +60,10 @@ public class BotanicNameDefaultCacheStrategy<T extends BotanicalName> extends No
                        exAuthorString = CdmUtils.Nz(exAuthor.getNomenclaturalTitle());\r
                        exAuthorString += ExAuthorSeperator;\r
                }\r
-               \r
-               result = exAuthorString + authorString; \r
+\r
+               result = exAuthorString + authorString;\r
                return result;\r
\r
+\r
        }\r
-       \r
+\r
 }\r
index 2810b3ce729737ab119785c4a1cde3c65e2eef17..b14cce2b095c8aa816ceb55d69b21792934225a4 100644 (file)
@@ -1,6 +1,3 @@
-package eu.etaxonomy.cdm.strategy.cache.taxon;
-
-
 /**
 * Copyright (C) 2015 EDIT
 * European Distributed Institute of Taxonomy
@@ -10,7 +7,7 @@ package eu.etaxonomy.cdm.strategy.cache.taxon;
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
-
+package eu.etaxonomy.cdm.strategy.cache.taxon;
 
 import java.util.ArrayList;
 import java.util.List;
index 593f0af4e16b9397ee7bf66f8700c245d9f6da11..dc5c0643c2304f8de052d64b36f1148638e7f8ba 100644 (file)
@@ -35,10 +35,10 @@ public class PolytomousKeyGenerator {
        private List<Feature> features; // the features used to generate the key
        private Set<TaxonDescription> taxa; // the base of taxa
 
-       private boolean merge=true; // if this boolean is set to true, branches of the tree will be merged if the corresponding states can be used together without decreasing their score 
+       private boolean merge=true; // if this boolean is set to true, branches of the tree will be merged if the corresponding states can be used together without decreasing their score
 
        private FeatureTree dependenciesTree; // the tree containing the dependencies between states and features (InapplicableIf and OnlyApplicableIf)
-       private Map<State,Set<Feature>> iIdependencies = new HashMap<State,Set<Feature>>(); // map of a set of Features (value) inapplicables if a State (key) is present 
+       private Map<State,Set<Feature>> iIdependencies = new HashMap<State,Set<Feature>>(); // map of a set of Features (value) inapplicables if a State (key) is present
        private Map<State,Set<Feature>> oAIdependencies = new HashMap<State,Set<Feature>>(); // map of a set of Features (value) only applicables if a State (key) is present
        private Map<Feature,Set<Feature>> featureDependencies = new HashMap<Feature,Set<Feature>>(); // map of all the sets of features (values) which have dependencies with states of other features (keys)
        private boolean dependenciesON = true; // if this boolean is true, the dependencies are taken into account
@@ -53,7 +53,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * Sets the features used to generate the key.
-        * 
+        *
         * @param featuresList
         */
        public void setFeatures(List<Feature> featuresList){
@@ -62,7 +62,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * Sets the base of taxa.
-        * 
+        *
         * @param featuresList
         */
        public void setTaxa(Set<TaxonDescription> taxaSet){
@@ -71,7 +71,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * Sets the tree containing the dependencies between states and features.
-        * 
+        *
         * @param tree
         */
        public void setDependencies(FeatureTree tree){
@@ -108,7 +108,7 @@ public class PolytomousKeyGenerator {
 
 
        /**
-        * Initializes the function buildBranches() with the starting parameters in order to build the key 
+        * Initializes the function buildBranches() with the starting parameters in order to build the key
         */
        private void loop(){
                polytomousKey = PolytomousKey.NewInstance();
@@ -136,7 +136,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * Recursive function that builds the branches of the identification key (FeatureTree)
-        * 
+        *
         * @param father the node considered
         * @param featuresLeft List of features that can be used at this point
         * @param taxaCovered the taxa left at this point (i.e. that verify the description corresponding to the path leading to this node)
@@ -190,8 +190,11 @@ public class PolytomousKeyGenerator {
                                                son.setStatement(statement);
                                                father.addChild(son);
                                                boolean areTheTaxaDiscriminated;
-                                               if (newTaxaCovered.size()==taxaCovered.size()) areTheTaxaDiscriminated = false;
-                                               else areTheTaxaDiscriminated = true;
+                                               if (newTaxaCovered.size()==taxaCovered.size()) {
+                            areTheTaxaDiscriminated = false;
+                        } else {
+                            areTheTaxaDiscriminated = true;
+                        }
                                                buildBranches(son,featuresLeft, newTaxaCovered,areTheTaxaDiscriminated);
                                        }
                                }
@@ -207,7 +210,9 @@ public class PolytomousKeyGenerator {
 
                                        // first, get the right DescriptionElementBase
                                        for (DescriptionElementBase deb : td.getElements()) {
-                                               if (deb.getFeature().equals(winnerFeature)) debConcerned = deb;
+                                               if (deb.getFeature().equals(winnerFeature)) {
+                            debConcerned = deb;
+                        }
                                        }
 
                                        if (debConcerned!=null) {
@@ -226,7 +231,7 @@ public class PolytomousKeyGenerator {
                                                                mergeBranches(clique,taxonStatesMap);
                                                        }
                                                }
-                                               if (taxonStatesMap!=null && !taxonStatesMap.isEmpty()) { 
+                                               if (taxonStatesMap!=null && !taxonStatesMap.isEmpty()) {
                                                        for (Map.Entry<Set<TaxonDescription>,List<State>> entry : taxonStatesMap.entrySet()){
                                                                Set<TaxonDescription> newTaxaCovered = entry.getKey();
                                                                List<State> listOfStates = entry.getValue();
@@ -239,13 +244,24 @@ public class PolytomousKeyGenerator {
                                                                                if (dependenciesON){
                                                                                        // if the dependencies are considered, removes and adds the right features from/to the list of features left
                                                                                        // these features are stored in order to be put back again when the current branch is finished
-                                                                                       if (iIdependencies.get(state)!= null) innapplicables.addAll(iIdependencies.get(state));
-                                                                                       if (oAIdependencies.get(state)!= null) applicables.addAll(oAIdependencies.get(state));
-                                                                                       for (Feature feature : innapplicables) featuresLeft.remove(feature);
-                                                                                       for (Feature feature : applicables) featuresLeft.add(feature);
+                                                                                       if (iIdependencies.get(state)!= null) {
+                                                innapplicables.addAll(iIdependencies.get(state));
+                                            }
+                                                                                       if (oAIdependencies.get(state)!= null) {
+                                                applicables.addAll(oAIdependencies.get(state));
+                                            }
+                                                                                       for (Feature feature : innapplicables) {
+                                                featuresLeft.remove(feature);
+                                            }
+                                                                                       for (Feature feature : applicables) {
+                                                featuresLeft.add(feature);
+                                            }
                                                                                }
                                                                                questionLabel.append(state.getLabel());
-                                                                               if (listOfStates.lastIndexOf(state)!=numberOfStates) questionLabel.append(separator); // append a separator after each state except for the last one
+                                                                               if (listOfStates.lastIndexOf(state)!=numberOfStates)
+                                         {
+                                            questionLabel.append(separator); // append a separator after each state except for the last one
+                                        }
                                                                        }
                                                                        // old code used when PolytomousKey extended FeatureTree
                                                                        //                                                                      Representation question = new Representation(null, questionLabel.toString(),null, Language.DEFAULT());
@@ -256,8 +272,11 @@ public class PolytomousKeyGenerator {
                                                                        father.addChild(son);
                                                                        featuresLeft.remove(winnerFeature); // unlike for quantitative features, once a categorical one has been used, it cannot be reused in the same branch
                                                                        boolean areTheTaxaDiscriminated;
-                                                                       if (newTaxaCovered.size()==taxaCovered.size()) areTheTaxaDiscriminated = true;
-                                                                       else areTheTaxaDiscriminated = false;
+                                                                       if (newTaxaCovered.size()==taxaCovered.size()) {
+                                        areTheTaxaDiscriminated = true;
+                                    } else {
+                                        areTheTaxaDiscriminated = false;
+                                    }
                                                                        buildBranches(son,featuresLeft, newTaxaCovered,areTheTaxaDiscriminated);
                                                                }
                                                        }
@@ -267,8 +286,12 @@ public class PolytomousKeyGenerator {
                        }
                        // the features depending on other features are added/removed to/from the features left once the branch is done
                        if (dependenciesON){
-                               for (Feature feature : innapplicables) featuresLeft.add(feature);
-                               for (Feature feature : applicables) featuresLeft.remove(feature);
+                               for (Feature feature : innapplicables) {
+                    featuresLeft.add(feature);
+                }
+                               for (Feature feature : applicables) {
+                    featuresLeft.remove(feature);
+                }
                        }
                        // the winner features are put back to the features left once the branch is done
                        featuresLeft.add(winnerFeature);
@@ -293,7 +316,7 @@ public class PolytomousKeyGenerator {
         * If the dependencies are on, this function calculates the score of all children features and give the highest score
         * of these to their father (of course, if its score is lower). This way, if a feature has a good score but is
         * "onlyApplicableIf" or "InapplicableIf", the feature it depends can be chosen in order to build a better key.
-        * 
+        *
         * @param scoreMap
         * @param featuresLeft
         * @param coveredTaxa
@@ -333,7 +356,7 @@ public class PolytomousKeyGenerator {
        /**
         * This function merges branches of the key belonging to the same clique
         * (http://en.wikipedia.org/wiki/Clique_%28graph_theory%29)
-        * 
+        *
         * @param clique the list of States linked together (i.e. if merged have the same score)
         * @param taxonStatesMap the map between the taxa (keys) and the states (keys) leading to them
         */
@@ -345,7 +368,7 @@ public class PolytomousKeyGenerator {
                if (clique.size()>1){
                        Iterator<Map.Entry<Set<TaxonDescription>, List<State>>> it1 = taxonStatesMap.entrySet().iterator();
                        while (it1.hasNext()){
-                               Map.Entry<Set<TaxonDescription>,List<State>> branch = (Map.Entry<Set<TaxonDescription>, List<State>>)it1.next();
+                               Map.Entry<Set<TaxonDescription>,List<State>> branch = it1.next();
                                Iterator<State> stateIterator = clique.iterator();
                                stateFound=false;
                                // looks for one state of the clique in this branch
@@ -382,7 +405,7 @@ public class PolytomousKeyGenerator {
         * This function looks for the largest clique of States
         * (http://en.wikipedia.org/wiki/Clique_%28graph_theory%29)
         * from the map of exclusions.
-        * 
+        *
         * @param exclusions map a state (key) to the set of states (value) which can not be merged with it without decreasing its score.
         * @return
         */
@@ -394,7 +417,7 @@ public class PolytomousKeyGenerator {
                // looks for the largest clique, i.e. the state with less exclusions
                State bestState=null;
                for (Iterator<Map.Entry<State,Set<State>>> it1 = exclusions.entrySet().iterator() ; it1.hasNext();){
-                       Map.Entry<State,Set<State>> pair = (Map.Entry<State,Set<State>>)it1.next();
+                       Map.Entry<State,Set<State>> pair = it1.next();
                        numberOfExclusions = pair.getValue().size();
                        if ((bestNumberOfExclusions==-1) || numberOfExclusions<bestNumberOfExclusions) {
                                bestNumberOfExclusions=numberOfExclusions;
@@ -408,10 +431,12 @@ public class PolytomousKeyGenerator {
                boolean isNotExcluded;
                // then starts building the clique by adding the states which do not exclude each other
                for (Iterator<Map.Entry<State,Set<State>>> iterator = exclusions.entrySet().iterator() ; iterator.hasNext();){
-                       Map.Entry<State,Set<State>> pair = (Map.Entry<State,Set<State>>)iterator.next();
+                       Map.Entry<State,Set<State>> pair = iterator.next();
                        isNotExcluded = true;
                        for (State state : clique) {
-                               if (pair.getValue().contains(state)) isNotExcluded = false;
+                               if (pair.getValue().contains(state)) {
+                    isNotExcluded = false;
+                }
                        }
                        if (isNotExcluded){
                                clique.add(pair.getKey());
@@ -426,7 +451,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * fills a map of the sets of taxa (key) presenting the different states (value) for the given feature.
-        * 
+        *
         * @param statesDone the list of states already done for this feature
         * @param categoricalData the element from which the states are extracted
         * @param feature the feature corresponding to the CategoricalData
@@ -461,7 +486,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * returns the list of taxa from previously covered taxa, which have the state featureState for the given feature
-        * 
+        *
         * @param feature
         * @param featureState
         * @param taxaCovered
@@ -481,7 +506,7 @@ public class PolytomousKeyGenerator {
                                                        }
                                                }
                                        }
-                               } 
+                               }
                        }
                }
                return newCoveredTaxa;
@@ -491,7 +516,7 @@ public class PolytomousKeyGenerator {
        /**
         * This function returns the feature with the highest score. However, if several features have the same score
         * the one wich leads to less options is chosen (this way, the key is easier to read).
-        * 
+        *
         * @param nTaxa
         * @param scores
         * @param taxaCovered
@@ -499,24 +524,26 @@ public class PolytomousKeyGenerator {
         */
        private Feature lessStatesWinner(Map<Feature,Float> scores, Set<TaxonDescription> taxaCovered){
                int nTaxa = taxaCovered.size();
-               if (nTaxa==1) return null;
-               float meanScore = defaultMeanScore(nTaxa); 
+               if (nTaxa==1) {
+            return null;
+        }
+               float meanScore = defaultMeanScore(nTaxa);
                float bestScore = nTaxa*nTaxa;
                List<Feature> bestFeatures = new ArrayList<Feature>(); // if ever different features have the best score, they are put in this list
                Feature bestFeature = null;
                Iterator<Map.Entry<Feature,Float>> it = scores.entrySet().iterator();
                float newScore;
                while (it.hasNext()){
-                       Map.Entry<Feature,Float> pair = (Map.Entry<Feature,Float>)it.next();
+                       Map.Entry<Feature,Float> pair = it.next();
                        if (pair.getValue()!=null){
-                               newScore = Math.abs((Float)pair.getValue()-meanScore);// the best score is the closest to the score (meanScore here)
+                               newScore = Math.abs(pair.getValue()-meanScore);// the best score is the closest to the score (meanScore here)
                                // a feature would have if it divided the taxa in two equal parts
                                if (newScore < bestScore){
                                        bestFeatures.clear();
-                                       bestFeatures.add((Feature)pair.getKey());
+                                       bestFeatures.add(pair.getKey());
                                        bestScore = newScore;
                                }else if (newScore==bestScore){
-                                       bestFeatures.add((Feature)pair.getKey());
+                                       bestFeatures.add(pair.getKey());
                                }
                        }
                }
@@ -541,7 +568,7 @@ public class PolytomousKeyGenerator {
                                                                        }
                                                                }
                                                        }
-                                               } 
+                                               }
                                        }
                                        numberOfDifferentStates=differentStates.size();
                                }else if (feature.isSupportsQuantitativeData()){
@@ -560,7 +587,7 @@ public class PolytomousKeyGenerator {
        /**
         * This function calculates the mean score, i.e. the score a feature dividing the taxa in two equal parts
         * would have.
-        * 
+        *
         * @param nTaxa
         * @return
         */
@@ -568,7 +595,7 @@ public class PolytomousKeyGenerator {
                int i;
                float score=0;
                for (i=1;i<nTaxa;i++){
-                       score = score + Math.round((float)(i+1/2));
+                       score = score + Math.round(i+1/2);
                }
                return score;
        }
@@ -576,7 +603,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * This function fills the map of features (keys) with their respecting scores (values)
-        * 
+        *
         * @param featuresLeft
         * @param coveredTaxa
         * @param quantitativeFeaturesThresholds
@@ -600,7 +627,7 @@ public class PolytomousKeyGenerator {
         * for a given quantitative feature, present either a lower or higher value than a given threshold.
         * It returns two Sets of TaxonDescription, one with the taxa under this threshold (taxaBefore) and another one
         * with the taxa over (taxaAfter).
-        * 
+        *
         * @param threshold
         * @param feature
         * @param taxa
@@ -648,7 +675,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * This function returns the score of a quantitative feature.
-        * 
+        *
         * @param feature
         * @param coveredTaxa
         * @param quantitativeFeaturesThresholds
@@ -733,14 +760,14 @@ public class PolytomousKeyGenerator {
                for (i=0;i<taxaBefore;i++) {
                        defaultQuantitativeScore += taxaAfter - i;
                }
-               return (float)(defaultQuantitativeScore);
+               return (defaultQuantitativeScore);
        }
 
 
 
        /**
         * This function returns the score of a categorical feature.
-        * 
+        *
         * @param feature
         * @param coveredTaxa
         * @return
@@ -776,21 +803,25 @@ public class PolytomousKeyGenerator {
 
        /**
         * This recursive function fills the maps of dependencies by reading the tree containing the dependencies.
-        * 
+        *
         * @param node
         */
        private void checkDependencies(FeatureNode node){
                if (node.getOnlyApplicableIf()!=null){
                        Set<State> addToOAI = node.getOnlyApplicableIf();
                        for (State state : addToOAI){
-                               if (oAIdependencies.containsKey(state)) oAIdependencies.put(state, new HashSet<Feature>());
+                               if (oAIdependencies.containsKey(state)) {
+                    oAIdependencies.put(state, new HashSet<Feature>());
+                }
                                oAIdependencies.get(state).add(node.getFeature());
                        }
                }
                if (node.getInapplicableIf()!=null){
                        Set<State> addToiI = node.getInapplicableIf();
                        for (State state : addToiI){
-                               if (iIdependencies.containsKey(state)) iIdependencies.put(state, new HashSet<Feature>());
+                               if (iIdependencies.containsKey(state)) {
+                    iIdependencies.put(state, new HashSet<Feature>());
+                }
                                iIdependencies.get(state).add(node.getFeature());
                        }
                }
@@ -805,7 +836,7 @@ public class PolytomousKeyGenerator {
 
        /**
         * This function fills the exclusions map.
-        * 
+        *
         * @param feature
         * @param coveredTaxa
         * @param exclusions
@@ -863,7 +894,7 @@ public class PolytomousKeyGenerator {
        /**
         * Returns the score between two DescriptionElementBase. If one of them is null, returns -1.
         * If they are not of the same type (Categorical) returns 0.
-        * 
+        *
         * @param deb1
         * @param deb2
         * @return
@@ -874,13 +905,14 @@ public class PolytomousKeyGenerator {
                }
                if ((deb1.isInstanceOf(CategoricalData.class))&&(deb2.isInstanceOf(CategoricalData.class))) {
                        return defaultCategoricalPower((CategoricalData)deb1, (CategoricalData)deb2);
-               }
-               else return 0;
+               } else {
+            return 0;
+        }
        }
 
        /**
         * Returns the score of a categorical feature.
-        * 
+        *
         * @param deb1
         * @param deb2
         * @return
@@ -925,8 +957,11 @@ public class PolytomousKeyGenerator {
                }
 
 
-               if (bool) return 0;
-               else return 1;
+               if (bool) {
+            return 0;
+        } else {
+            return 1;
+        }
        }
 
        // old code used when PolytomousKey extended FeatureTree
index 616a52b02c82de8969d44b16e03ee6f367ad7248..dc994b0d119d226209ff42034b99d5acfb040534 100644 (file)
@@ -18,7 +18,6 @@ import eu.etaxonomy.cdm.model.reference.Reference;
  *
  * @author n.hoffmann
  * @created Jan 22, 2010
- * @version 1.0
  */
 public class MatchStrategyConfigurator {
 
index befd063b7363f0b75f1b2ef604002c3cffd7ac20..8621cf2b5cc0064d7f7612a3cf248c517631794f 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -19,25 +19,24 @@ import org.apache.log4j.Logger;
 /**\r
  * @author a.mueller\r
  * @created 07.08.2009\r
- * @version 1.0\r
  */\r
 public class Matching {\r
        @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(Matching.class);\r
-       \r
+\r
        private SortedMap<String, FieldMatcher> fieldMatchers = new TreeMap<String, FieldMatcher>();\r
        private SortedMap<String, FieldMatcher> tmpFieldMatchers = new TreeMap<String, FieldMatcher>();\r
        private List<CacheMatcher> cacheMatchers = new ArrayList<CacheMatcher>();\r
-       \r
+\r
 \r
        public Matching setFieldMatcher(FieldMatcher fieldMatcher){\r
                return setFieldMatcher(fieldMatcher, false);\r
        }\r
-       \r
+\r
        public Matching setFieldMatcher(FieldMatcher fieldMatcher,boolean temporary){\r
                String propertyName = fieldMatcher.getPropertyName();\r
                if (temporary && ! fieldMatchers.containsKey(propertyName)){\r
-                       tmpFieldMatchers.put(propertyName, fieldMatcher);       \r
+                       tmpFieldMatchers.put(propertyName, fieldMatcher);\r
                }else{\r
                        fieldMatchers.put(propertyName, fieldMatcher);\r
                }\r
@@ -60,18 +59,18 @@ public class Matching {
                if (includeTemporary){\r
                        for (FieldMatcher fieldMatcher : tmpFieldMatchers.values()){\r
                                result.add(fieldMatcher);\r
-                       }       \r
+                       }\r
                }\r
                return result;\r
        }\r
-       \r
+\r
        /**\r
         * @return the fieldMatchers\r
         */\r
        public FieldMatcher getFieldMatcher(String propertyName) {\r
                return fieldMatchers.get(propertyName);\r
        }\r
-       \r
+\r
        public boolean exists(String propertyName){\r
                return getFieldMatcher(propertyName) != null;\r
        }\r
@@ -86,6 +85,6 @@ public class Matching {
        public void deleteTemporaryMatchers(){\r
                tmpFieldMatchers = new TreeMap<String, FieldMatcher>();\r
        }\r
-       \r
-       \r
+\r
+\r
 }\r
index 221dc0b6e54731cb557f883fa44e1b2aaa26cfde..3edd3649722688fdf77a28441b8141b66843f3b8 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -21,18 +21,18 @@ import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
 public class NameTypeParser {\r
 \r
        private static final String desigPattern =  "\\sdesig(\\.|nation)?";\r
-       \r
+\r
        /**\r
         * see also CentralAfricaFernsTaxonParser#handleTypeLocationPart\r
         */\r
-       public static final String typeTypePattern = "("+ \r
+       public static final String typeTypePattern = "("+\r
                        "lecto(\\.|type)?+" +\r
                        "(original|present|subsequent)"+ desigPattern +\r
-                       "(subsequent monotypy|tautonomy)" + \r
+                       "(subsequent monotypy|tautonomy)" +\r
                        ")";\r
-       \r
-       \r
-       \r
+\r
+\r
+\r
        public static NameTypeDesignationStatus parseNameTypeStatus(String type) throws UnknownCdmTypeException {\r
                if (StringUtils.isBlank(type)){\r
                        return null;\r
@@ -45,7 +45,7 @@ public class NameTypeParser {
                        }else if (type.matches("(?i)subsequent" + desigPattern)){\r
                                return NameTypeDesignationStatus.SUBSEQUENT_DESIGNATION();\r
                        }\r
-                       \r
+\r
                }else if(type.matches("(?i)subsequent monotypy")){\r
                        return NameTypeDesignationStatus.SUBSEQUENT_MONOTYPY();\r
                }else if(type.matches("(?i)monotypy")){\r
@@ -61,6 +61,6 @@ public class NameTypeParser {
                }\r
                String message = "Type Status not supported: " + type;\r
                throw new UnknownCdmTypeException(message);\r
-               \r
+\r
        }\r
 }\r
index 07b093af56a3b076ff61f56e62ed7d932e5e3a6c..a3acd2963a1178ad3763f335975b08a7e0dcc85a 100644 (file)
@@ -1,8 +1,8 @@
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -16,29 +16,27 @@ import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
 /**\r
  * @author a.mueller\r
  * @date 25.07.2011\r
- *\r
  */\r
 public class SpecimenTypeParser {\r
 \r
-\r
        public static class TypeInfo{\r
                public SpecimenTypeDesignationStatus status;\r
                public String collectionString;\r
                public boolean notDesignated;\r
        }\r
-       \r
+\r
        /**\r
         * see also CentralAfricaFernsTaxonParser#handleTypeLocationPart\r
         */\r
        public static final String typeTypePattern = "(?i)(holo|lecto|iso|isolecto|syn|isosyn|neo|isoneo|type)\\.?";\r
        public static final String collectionPattern = "^[A-Z]+(\\-[A-Z]+)?";\r
-       \r
-       \r
-       \r
+\r
+\r
+\r
        public static SpecimenTypeDesignationStatus parseSpecimenTypeStatus(String type) throws UnknownCdmTypeException {\r
                //TODO also compare with NameTypeParser\r
                //TODO further types\r
-               \r
+\r
                if (StringUtils.isBlank(type)){\r
                        return null;\r
                }else if (type.endsWith("type") && ! type.equalsIgnoreCase("type")){\r
@@ -46,8 +44,8 @@ public class SpecimenTypeParser {
                }else if (type.endsWith("types") && ! type.equalsIgnoreCase("types")){\r
                        type = type.substring(0, type.length() -5 );\r
                }\r
-               \r
-               SpecimenTypeDesignationStatus status; \r
+\r
+               SpecimenTypeDesignationStatus status;\r
                if (type.equalsIgnoreCase("iso")){\r
                        status = SpecimenTypeDesignationStatus.ISOTYPE();\r
                }else if (type.equalsIgnoreCase("isolecto")){\r
diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/TaxonNameParserHistory.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/TaxonNameParserHistory.java
deleted file mode 100644 (file)
index bb6a3b3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.strategy.parser;\r
-\r
-import org.apache.log4j.Logger;\r
-\r
-/**\r
- * @author a.mueller\r
- * @date 12.05.2010\r
- *\r
- */\r
-public class TaxonNameParserHistory {\r
-       private static final Logger logger = Logger.getLogger(TaxonNameParserHistory.class);\r
-       \r
-       \r
-       \r
-       \r
-       \r
-       \r
-       \r
-       /**\r
-        * @param args\r
-        */\r
-       public static void main(String[] args) {\r
-               // TODO Auto-generated method stub\r
-\r
-       }\r
-\r
-}\r
index cb1db3491aec05a9fff568b984f175cfca9d9ec4..8c778feed96392db732d7da1d3f0de570d64ef33 100644 (file)
@@ -16,7 +16,6 @@ import javax.validation.ConstraintValidatorContext;
 \r
 import org.hibernate.Hibernate;\r
 \r
-//import org.hibernate.Hibernate;\r
 import eu.etaxonomy.cdm.model.taxon.Synonym;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
index a418e3032981d9be653ad1a3999bde70230bbcef..455ca79f9132e65bb4b9877dc8817da446ab7b23 100644 (file)
@@ -13,9 +13,9 @@ import eu.etaxonomy.cdm.validation.Level2;
 /**\r
  * A Mock class for testing entity validation tasks. DO NOT MODIFY UNLESS YOU ALSO MODIFY\r
  * THE UNIT TESTS MAKING USE OF THIS CLASS!\r
- * \r
+ *\r
  * @author ayco_holleman\r
- * \r
+ *\r
  */\r
 @SuppressWarnings("serial")\r
 public class Address extends CdmBase {\r
@@ -33,7 +33,7 @@ public class Address extends CdmBase {
                this.street = street;\r
        }\r
 \r
-\r
+       @Override\r
        public boolean equals(Object obj){\r
                if (this == obj) {\r
                        return true;\r
@@ -45,7 +45,8 @@ public class Address extends CdmBase {
        }\r
 \r
 \r
-       public int hashCode(){\r
+       @Override\r
+    public int hashCode(){\r
                return street.hashCode();\r
        }\r
 \r
index 60282b0dff84f5840951c436a30a2a746edcdf52..a02c7ab96efdc215c79b7cd4ac31bab834709120 100644 (file)
@@ -31,6 +31,7 @@ import eu.etaxonomy.cdm.persistence.dao.hibernate.name.TypeDesignationDaoHiberna
     )
 public class TestsShouldNotFailInSuite_2 {
 
+    @SuppressWarnings("unused")
     private static final  Logger logger = Logger.getLogger(TestsShouldNotFailInSuite_2.class);
 
     // the class remains completely empty,