changeset 8363:3508d625092f

wUnit might be null.
author Tom Gottfried <tom@intevation.de>
date Thu, 02 Oct 2014 09:42:12 +0200
parents 839032ac1523
children abef2584c9a7 a5bd0a5b8efd
files artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Wed Oct 01 15:54:47 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Thu Oct 02 09:42:12 2014 +0200
@@ -165,7 +165,7 @@
         RangeAccess access = new RangeAccess((D4EArtifact)master);
         double[] km = access.getLocations();
         // If we are not at gauge (cm) use the river unit
-        String realUnit = wUnit.equals("cm") ? "cm" : riverUnit;
+        String realUnit = "cm".equals(wUnit) ? "cm" : riverUnit;
         String header =
             msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER, new Object[] {realUnit});
 
@@ -182,7 +182,7 @@
      * @return the number formatter for W values.
      */
     protected NumberFormat getWFormatter() {
-        if (wUnit.equals("cm")) {
+        if ("cm".equals(wUnit)) {
             return Formatter.getFormatter(context, 0, 0);
         }
         return Formatter.getComputedDischargeW(context);
@@ -254,7 +254,7 @@
 
         source.addMetaData("date", df.format(new Date()));
 
-        source.addMetaData("wUnit", wUnit.equals("cm") ? "cm" : riverUnit);
+        source.addMetaData("wUnit", "cm".equals(wUnit) ? "cm" : riverUnit);
 
         RangeAccess rangeAccess = new RangeAccess(flys);
         double[] kms = rangeAccess.getKmRange();

http://dive4elements.wald.intevation.org