rename abstract classes and some other cleanup
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / format / ReferencingObjectFormatter.java
index d8b456eb4fa13dfb4a5ee39441f9578a694a4e8a..14fe9f2d817616b5ea0ba3438831e7c101b2a16b 100644 (file)
@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.format.ICdmFormatter.FormatKey;
 import eu.etaxonomy.cdm.format.description.CategoricalDataFormatter;
+import eu.etaxonomy.cdm.format.description.DescriptionElementFormatter;
 import eu.etaxonomy.cdm.format.description.QuantitativeDataFormatter;
 import eu.etaxonomy.cdm.format.occurrences.DistanceStringFormatter;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
@@ -529,8 +530,6 @@ public class ReferencingObjectFormatter {
         return result;
     }
 
-
-
     private static String getCache(StateData stateData,
             Language defaultLanguage) {
         String cache = null;
@@ -554,14 +553,15 @@ public class ReferencingObjectFormatter {
                 cache = rep.getLabel();
             }
         }
-        cache = CdmUtils.concat("=", cache, smv.getValue().toString());
+        if (smv.getValue() != null) {
+            cache = CdmUtils.concat("=", cache, smv.getValue().toString());
+        }
         cache = isBlank(cache)? smv.getUuid().toString() : cache;
         DescriptionBase<?> desc = smv.getQuantitativeData() == null? null : smv.getQuantitativeData().getInDescription();
         String mainElementLabel = mainElementLabel(desc);
         return concatWithMainElement(mainElementLabel, cache);
     }
 
-
     /**
      * Returns the label of the main element (taxon, specimen or name) for
      * the given description.