[PATCH 1 of 2] (issue1225) Use label code also when only one item is present

Wald Commits scm-commit at wald.intevation.org
Wed Nov 27 16:25:18 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1385397647 -3600
# Node ID 25bce6e8beea5a769ccac4b053d0fab8affd2720
# Parent  c50dbbe17950a773fe1bb28ed8431c7bd1ae89a0
(issue1225) Use label code also when only one item is present

diff -r c50dbbe17950 -r 25bce6e8beea artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Wed Nov 27 14:55:25 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Mon Nov 25 17:40:47 2013 +0100
@@ -1071,7 +1071,7 @@
     protected String getDefaultYAxisLabel(String axisName) {
         Set labelSet = axesLabels.get(diagramAttributes.getAxisIndex(axisName));
         logger.debug("Labels for axis: " + labelSet);
-        if (labelSet != null && labelSet.size() >= 2) {
+        if (labelSet != null && !labelSet.isEmpty()) {
             String label = StringUtils.join(labelSet, ", ");
             Matcher units = UNIT_PATTERN.matcher(label);
             if (units.find()) {


More information about the Dive4elements-commits mailing list