cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Fri, 21 Aug 2020 09:32:52 +0000 (11:32 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Fri, 21 Aug 2020 09:32:52 +0000 (11:32 +0200)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/format/description/AbstractCategoricalDescriptionBuilder.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/format/description/MicroFormatCategoricalDescriptionBuilder.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/jaxb/FormattedTextAdapter.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TaxonName.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/validation/constraint/CorrectEpithetsForRankValidator.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/agent/PersonDefaultCacheStrategyTest.java
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/agent/TeamDefaultCacheStrategyTest.java
cdmlib-persistence/pom.xml
pom.xml

index 7d61b1a8d58d1d5e521613b8bba75b793efedc8b..3bb462df089c16a00bc745142cc01f2481f4f8f3 100644 (file)
@@ -19,7 +19,8 @@ import eu.etaxonomy.cdm.model.description.TextData;
  * @author m.venin
  * @since 2010
  */
-public abstract class AbstractCategoricalDescriptionBuilder extends DescriptionBuilder<CategoricalData>{
+public abstract class AbstractCategoricalDescriptionBuilder
+        extends DescriptionBuilder<CategoricalData>{
 
        @Override
     public TextData build(CategoricalData data, List<Language> languages) {
index 93ecc5c3632132f4486b8adaec1921f1ddbdc930..93817f694a6deab6b316967b746cf0d0bf59eb20 100644 (file)
@@ -26,7 +26,8 @@ import eu.etaxonomy.cdm.model.term.DefinedTerm;
  * @author m.venin
  * @since 2010
  */
-public class MicroFormatCategoricalDescriptionBuilder extends AbstractCategoricalDescriptionBuilder{
+public class MicroFormatCategoricalDescriptionBuilder
+        extends AbstractCategoricalDescriptionBuilder{
 
        private final String spanEnd = "</span>";
 
index d19029523f11d61575c4c012f7d30ecc091f98fc..06e0662bf0a0d48cb7533a04548d13b89b46dd08 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.jaxb;\r
 \r
@@ -50,8 +50,9 @@ public class FormattedTextAdapter extends XmlAdapter<FormattedText,java.lang.Str
 \r
        @SuppressWarnings("unused")\r
        private static final Log logger = LogFactory.getLog(FormattedTextAdapter.class);\r
-       \r
-       public FormattedText marshal(String string) throws Exception {\r
+\r
+       @Override\r
+    public FormattedText marshal(String string) throws Exception {\r
                if(string != null) {\r
                        string = StringEscapeUtils.escapeXml(string);\r
                        String documentString = "<?xml version=\"1.0\"?><text>"  + string + "</text>";\r
@@ -65,7 +66,7 @@ public class FormattedTextAdapter extends XmlAdapter<FormattedText,java.lang.Str
                        Node node = childNodes.item(i);\r
                        if(node instanceof org.w3c.dom.Text ) {\r
                                org.w3c.dom.Text textNode = (org.w3c.dom.Text) node;\r
-                               \r
+\r
                                text.getContent().add(textNode.getTextContent());\r
                        } else {\r
                            text.getContent().add(node);\r
@@ -76,11 +77,12 @@ public class FormattedTextAdapter extends XmlAdapter<FormattedText,java.lang.Str
                return null;\r
        }\r
 \r
-       public String unmarshal(FormattedText text) throws Exception {\r
+       @Override\r
+    public String unmarshal(FormattedText text) throws Exception {\r
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r
                Document document = factory.newDocumentBuilder().newDocument();\r
                DocumentFragment documentFragment = document.createDocumentFragment();\r
-               \r
+\r
                for(Object object : text.getContent()) {\r
                        if(object instanceof String) {\r
                                String string = (String)object;\r
@@ -96,7 +98,7 @@ public class FormattedTextAdapter extends XmlAdapter<FormattedText,java.lang.Str
                                                        throw de;\r
                                                }\r
                                        }\r
-                                       \r
+\r
                                }\r
 \r
                                documentFragment.appendChild(document.importNode(node,true));\r
@@ -107,7 +109,7 @@ public class FormattedTextAdapter extends XmlAdapter<FormattedText,java.lang.Str
                TransformerFactory transformerFactory  = TransformerFactory.newInstance();\r
                Transformer transformer = transformerFactory.newTransformer();\r
                transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION , "yes");\r
-               \r
+\r
                Source input = new DOMSource(documentFragment);\r
                StringWriter stringWriter = new StringWriter();\r
                Result output = new StreamResult(stringWriter);\r
index 4252d22b77fce21a08044ccf66436c0b78c4757f..add0d374de0a560fb5cd1d607ac4e0b97f74f7e5 100644 (file)
@@ -3376,17 +3376,11 @@ public class TaxonName
         return result;
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean isHybridName() {
         return this.isMonomHybrid() || this.isBinomHybrid() || this.isTrinomHybrid();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public boolean isHybrid() {
         return this.isHybridName() || this.isHybridFormula();
@@ -3430,7 +3424,6 @@ public class TaxonName
             this.setNameCache(oldNameCache, isProtected);
         }
 
-
         // Compare name cache of taxon names
         if (CdmUtils.isNotBlank(otherNameCache) && CdmUtils.isNotBlank(thisNameCache)) {
             thisNameCache = normalizeName(thisNameCache);
@@ -3453,12 +3446,6 @@ public class TaxonName
     static final String HYBRID_SIGN = UTF8.HYBRID.toString();
     static final String QUOT_SIGN = "[\\u02BA\\u0022\\u0022]";
 
-    /**
-     * @param thisNameCache
-     * @param HYBRID_SIGN
-     * @param QUOT_SIGN
-     * @return
-     */
     private String normalizeName(String thisNameCache) {
         thisNameCache = thisNameCache.replaceAll(HYBRID_SIGN, "");
         thisNameCache = thisNameCache.replaceAll(QUOT_SIGN, "");
@@ -3499,14 +3486,10 @@ public class TaxonName
 
 //************************ isType ***********************************************/
 
-    /**
-     * @return
-     */
     @Override
     public boolean isNonViral() {
         return nameType.isNonViral();
     }
-
     @Override
     public boolean isZoological(){
         return nameType.isZoological();
@@ -3572,10 +3555,6 @@ public class TaxonName
         return false;
     }
 
-
-    /**
-     * @return
-     */
     private boolean updateFullTitleCache() {
         if (protectedFullTitleCache == false){
             String oldCache = this.fullTitleCache;
@@ -3589,7 +3568,6 @@ public class TaxonName
         return false;
     }
 
-
 //*********************** CLONE ********************************************************/
 
     /**
@@ -3633,7 +3611,6 @@ public class TaxonName
                 result.status.add(newStatus);
             }
 
-
             //to relations
             result.relationsToThisName = new HashSet<>();
             for (NameRelationship toRelationship : getRelationsToThisName()){
@@ -3663,7 +3640,6 @@ public class TaxonName
             result.homotypicalGroup = HomotypicalGroup.NewInstance();
             result.homotypicalGroup.addTypifiedName(this);
 
-
             //HybridChildRelations
             result.hybridChildRelations = new HashSet<>();
             for (HybridRelationship hybridRelationship : getHybridChildRelations()){
index c291a67bdd0c62df876278466b6f211f5429c4ab..e22720a81f9fd6a2fccfbbf0c90dd870fad5317b 100644 (file)
@@ -79,10 +79,6 @@ public class CorrectEpithetsForRankValidator implements ConstraintValidator<Corr
                return valid;\r
        }\r
 \r
-    /**\r
-     * @param specificEpithet\r
-     * @return\r
-     */\r
     private boolean isNotBlank(String str) {\r
         return StringUtils.isNotBlank(str);\r
     }\r
index 8575f55d80ea5f3bbe1dcefd993ea24550850728..fb4709df248afb0dcb31c9933528c053f49c76b6 100644 (file)
@@ -6,19 +6,14 @@
 * 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
 package eu.etaxonomy.cdm.strategy.cache.agent;\r
 \r
-\r
 import static org.junit.Assert.assertNotNull;\r
 \r
 import org.apache.commons.lang3.StringUtils;\r
 import org.apache.log4j.Logger;\r
-import org.junit.After;\r
-import org.junit.AfterClass;\r
 import org.junit.Assert;\r
 import org.junit.Before;\r
-import org.junit.BeforeClass;\r
 import org.junit.Test;\r
 \r
 import eu.etaxonomy.cdm.model.agent.Person;\r
@@ -28,32 +23,14 @@ import eu.etaxonomy.cdm.model.agent.Person;
  * @since 29.09.2009\r
  */\r
 public class PersonDefaultCacheStrategyTest {\r
-       @SuppressWarnings("unused")\r
+\r
+    @SuppressWarnings("unused")\r
        private static final Logger logger = Logger.getLogger(PersonDefaultCacheStrategyTest.class);\r
 \r
        private static Person person1;\r
        private static Person person2;\r
        private static Person person3;\r
 \r
-       /**\r
-        * @throws java.lang.Exception\r
-        */\r
-       @BeforeClass\r
-       public static void setUpBeforeClass() throws Exception {\r
-       }\r
-\r
-       /**\r
-        * @throws java.lang.Exception\r
-        */\r
-       @AfterClass\r
-       public static void tearDownAfterClass() throws Exception {\r
-\r
-\r
-       }\r
-\r
-       /**\r
-        * @throws java.lang.Exception\r
-        */\r
        @Before\r
        public void setUp() throws Exception {\r
                person1 = Person.NewInstance();\r
@@ -70,21 +47,10 @@ public class PersonDefaultCacheStrategyTest {
                person2.setSuffix("P2Suff");\r
 \r
                person3 = Person.NewInstance(); //empty person\r
-\r
-       }\r
-\r
-       /**\r
-        * @throws java.lang.Exception\r
-        */\r
-       @After\r
-       public void tearDown() throws Exception {\r
        }\r
 \r
 //**************************************** TESTS **************************************\r
 \r
-       /**\r
-        * Test method for {@link eu.etaxonomy.cdm.strategy.cache.agent.PersonDefaultCacheStrategy#NewInstance()}.\r
-        */\r
        @Test\r
        public final void testNewInstance() {\r
                PersonDefaultCacheStrategy cacheStrategy = PersonDefaultCacheStrategy.NewInstance();\r
@@ -106,7 +72,6 @@ public class PersonDefaultCacheStrategyTest {
                Assert.assertEquals("Person3 title should start with Person#0", "Person#0", person3.getNomenclaturalTitle().substring(0, 8));\r
        }\r
 \r
-\r
        @Test\r
        public final void testGetTitleCacheAdaptedFromOldVersion(){\r
            Assert.assertNotNull("person1 title cache must not to be null", person1.getTitleCache());\r
@@ -152,7 +117,6 @@ public class PersonDefaultCacheStrategyTest {
                 expected, pers.getTitleCache());\r
     }\r
 \r
-\r
     @Test\r
     public final void testGetFullTitle(){\r
         Assert.assertNotNull("person1 full titlemust not to be null", person1.getFullTitle());\r
@@ -292,7 +256,5 @@ public class PersonDefaultCacheStrategyTest {
         Assert.assertEquals("W.-H.-", formatter.getInitialsFromGivenName(givenname, force));\r
         givenname = "W.-Hennin-";\r
         Assert.assertEquals("W.-H.-", formatter.getInitialsFromGivenName(givenname, force));\r
-\r
        }\r
-\r
 }\r
index b4147d589ff27c9f59f923e3633e211743cbc4af..f11775f7600d8806991a46db532ce7eae2f1992a 100644 (file)
@@ -6,19 +6,15 @@
 * 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.strategy.cache.agent;
 
-
 import static org.junit.Assert.assertNotNull;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 import eu.etaxonomy.cdm.model.agent.Person;
@@ -29,7 +25,8 @@ import eu.etaxonomy.cdm.model.agent.Team;
  * @since 29.09.2009
  */
 public class TeamDefaultCacheStrategyTest {
-       @SuppressWarnings("unused")
+
+    @SuppressWarnings("unused")
        private static final Logger logger = Logger.getLogger(TeamDefaultCacheStrategyTest.class);
 
        private static Team team1;
@@ -41,25 +38,6 @@ public class TeamDefaultCacheStrategyTest {
        private static Person person3;
        private static Person person4;
 
-       /**
-        * @throws java.lang.Exception
-        */
-       @BeforeClass
-       public static void setUpBeforeClass() throws Exception {
-       }
-
-       /**
-        * @throws java.lang.Exception
-        */
-       @AfterClass
-       public static void tearDownAfterClass() throws Exception {
-
-
-       }
-
-       /**
-        * @throws java.lang.Exception
-        */
        @Before
        public void setUp() throws Exception {
                team1 = Team.NewInstance();
@@ -89,23 +67,14 @@ public class TeamDefaultCacheStrategyTest {
                team2.addTeamMember(person2);
                team2.addTeamMember(person1);
                team2.addTeamMember(person3);
-
-
-
        }
 
-       /**
-        * @throws java.lang.Exception
-        */
        @After
        public void tearDown() throws Exception {
        }
 
 //**************************************** TESTS **************************************
 
-       /**
-        * Test method for {@link eu.etaxonomy.cdm.strategy.cache.agent.PersonDefaultCacheStrategy#NewInstance()}.
-        */
        @Test
        public final void testNewInstance() {
                TeamDefaultCacheStrategy cacheStrategy = TeamDefaultCacheStrategy.NewInstance();
@@ -166,7 +135,6 @@ public class TeamDefaultCacheStrategyTest {
         Assert.assertEquals("team2 nomenclatural title should still be 'P2LN, P., P1LN, P. & al.' now.",
                 "P2LN, P., P1LN, P. & al.", team2.getTitleCache());
 
-
                //person3
                Assert.assertNotNull("team3 title cache must not to be null",
                        team3.getTitleCache());
@@ -214,5 +182,4 @@ public class TeamDefaultCacheStrategyTest {
                person1.setGivenName("O.");
                Assert.assertEquals("team1 title cache should be P1LN, O.", "P1LN, O.", team1.getTitleCache());
        }
-
 }
index 0218d3d60135b3358bfad57c29e78a4f586bdf07..2af3cadf8b629e678243fc84fcc47c24b6875bec 100644 (file)
         </exclusion>
       </exclusions>
     </dependency>
-    <!-- Since hibernate 5.0.4 the logging for a Dialect throws ClassDefNotFound for javax.transaction.SystemException if jta is missing  -->
     <dependency>
+      <!-- Since hibernate 5.0.4 the logging for a Dialect throws ClassDefNotFound for javax.transaction.SystemException if jta is missing  -->
       <groupId>javax.transaction</groupId>
       <artifactId>jta</artifactId>
     </dependency>  
diff --git a/pom.xml b/pom.xml
index 3204aaf45fae47f44f30c98051915abbaf441760..134e39f9e500fb76dbb08c06d04e5153a0e27929 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <version>3.4.1.Final</version>
         <!-- checked 2020-08 -->
       </dependency>
-         <!-- since hibernate 5.0.4 Dialect throws exception if jta is missing  -->
          <dependency>
+           <!-- since hibernate 5.0.4 Dialect throws exception if jta is missing  -->
         <groupId>javax.transaction</groupId>
         <artifactId>jta</artifactId>
         <version>1.1</version>
         <artifactId>xml-apis</artifactId>
         <!-- 
             WARNING: do not upgrade to later versions 2.0.x of xml-apis
-            since these are effectivly reloated to the early beta version
+            since these are effectivly reloaded to the early beta version
             1.0.b2
         -->
         <version>1.4.01</version>