cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Thu, 13 May 2021 16:48:46 +0000 (18:48 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Thu, 13 May 2021 16:48:46 +0000 (18:48 +0200)
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplRegExBase.java

index fd991b8969311b170189c5c14c9e113f26f8c5ba..68a338d0a0e811dfc833c73ded8e95e193cb2781 100644 (file)
@@ -364,9 +364,7 @@ public class NonViralNameParserImpl
 
            //problem start
            int start = nameToBeFilled.getProblemStarts();
-           int nameLength = name.length();
            int nameAndSeparatorLength = nameAndSeparator.length();
-           int fullRefLength = nameToBeFilled.getFullTitleCache().length();
 
            if (nameToBeFilled.isProtectedTitleCache() || nameToBeFilled.getParsingProblems().contains(ParserProblem.CheckRank)){
                start = Math.max(0, start);
@@ -469,12 +467,12 @@ public class NonViralNameParserImpl
     //TODO make it an Array of status
        /**
         * Extracts a {@link NomenclaturalStatus} from the reference String and adds it to the @link {@link TaxonName}.
-        * The nomenclatural status part ist deleted from the reference String.
+        * The nomenclatural status part is deleted from the reference String.
         * @return  String the new (shortend) reference String
         */
        public String parseNomStatus(String fullString, INonViralName nameToBeFilled, boolean makeEmpty) {
-               Set<NomenclaturalStatusType> existingStatusTypeSet = new HashSet<NomenclaturalStatusType>();
-               Set<NomenclaturalStatusType> newStatusTypeSet = new HashSet<NomenclaturalStatusType>();
+               Set<NomenclaturalStatusType> existingStatusTypeSet = new HashSet<>();
+               Set<NomenclaturalStatusType> newStatusTypeSet = new HashSet<>();
                for (NomenclaturalStatus existingStatus : nameToBeFilled.getStatus()){
                        existingStatusTypeSet.add(existingStatus.getType());
                }
@@ -505,7 +503,7 @@ public class NonViralNameParserImpl
                }
                //remove not existing nom status
                if (makeEmpty){
-                       Set<NomenclaturalStatus> tmpStatus = new HashSet<NomenclaturalStatus>();
+                       Set<NomenclaturalStatus> tmpStatus = new HashSet<>();
                        tmpStatus.addAll(nameToBeFilled.getStatus());
                        for (NomenclaturalStatus status : tmpStatus){
                                if (! newStatusTypeSet.contains(status.getType())){
index 1aa905d7297705b00460d1edd1fadd94124c1ae1..c76489581433adc15a04d7243a085069ff40d237 100644 (file)
@@ -162,8 +162,6 @@ public abstract class NonViralNameParserImplRegExBase  {
     protected static String pPages = "(" + pSinglePages +"|" + pMultiPages +")";
     protected static String pPagesTabFig = pPages +"([,\\.]" + fWs + pTabFigPl + "){1,2}";
 
-
-
     protected static String pCouv = "couv\\." + fWs + "\\d{1,3}";
 
     protected static String pTabSpecial = "tab\\." + fWs + "(ad" + fWs + "\\d{1,3}|alphab)";
@@ -264,14 +262,12 @@ public abstract class NonViralNameParserImplRegExBase  {
     protected static String pNomStatusPhrase = "(?:" + pNomStatusPhrase1 + "|" + pNomStatusPhrase2 + ")";
 
 // Soraya
-//opus utique oppr.
 //pro syn.
 //provisional synonym
 //fossil name
 
-
     //cultivars and hybrids
-    protected static String cultivar = oWs + "'..+'"; //Achtung mit Hochkomma in AuthorNamen
+    protected static String cultivar = oWs + "'..+'"; //Careful with apostorph in author names
     protected static String cultivarMarker = oWs + "(cv\\.|')";
     protected static String notho = "notho";
     protected static String hybridPart = "([xX]" + oWs + "|"+hybridSign+"|"+notho+")";