diff artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java @ 8202:e4606eae8ea5

sed src/**/*.java 's/logger/log/g'
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 12:58:17 +0200
parents a1ceacf15d3a
children 0d3d018fc632
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Fri Sep 05 12:54:58 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Fri Sep 05 12:58:17 2014 +0200
@@ -58,8 +58,8 @@
 @Deprecated
 public class RiverUtils {
 
-    /** The logger that is used in this utility. */
-    private static Logger logger = Logger.getLogger(RiverUtils.class);
+    /** The log that is used in this utility. */
+    private static Logger log = Logger.getLogger(RiverUtils.class);
 
     /**
      * An enum that represents the 5 possible WQ modes in FLYS. The 5 values are
@@ -120,12 +120,12 @@
             Artifact artifact = context.getDatabase().getRawArtifact(uuid);
 
             if (artifact == null) {
-                logger.error("Artifact '" + uuid + "' does not exist.");
+                log.error("Artifact '" + uuid + "' does not exist.");
                 return null;
             }
 
             if (!(artifact instanceof D4EArtifact)) {
-                logger.error("Artifact '" +uuid+ "' is no valid D4EArtifact.");
+                log.error("Artifact '" +uuid+ "' is no valid D4EArtifact.");
                 return null;
             }
 
@@ -133,7 +133,7 @@
         }
         // TODO: catch more selective
         catch (Exception e) {
-            logger.error("Cannot get D4EArtifact " + uuid
+            log.error("Cannot get D4EArtifact " + uuid
                 + " from database (" + e.getMessage() + ").");
             return null;
         }
@@ -251,7 +251,7 @@
             riverName = "";
         }
 
-        logger.debug("Search for the min/max distances of '" + riverName + "'");
+        log.debug("Search for the min/max distances of '" + riverName + "'");
 
         // Why not use getRiver(flysArtifact) ?
         River river = RiverFactory.getRiver(riverName);
@@ -319,7 +319,7 @@
                 locations.add(Double.parseDouble(l));
             }
             catch (NumberFormatException nfe) {
-                logger.debug(nfe.getLocalizedMessage(), nfe);
+                log.debug(nfe.getLocalizedMessage(), nfe);
             }
         }
 
@@ -343,7 +343,7 @@
             return ((WINFOArtifact) flys).getQs();
         }
 
-        logger.warn("This method (getQs) currently supports WINFOArtifact only!");
+        log.warn("This method (getQs) currently supports WINFOArtifact only!");
 
         return null;
     }
@@ -363,7 +363,7 @@
             return ((WINFOArtifact) flys).getWs();
         }
 
-        logger.warn("This method (getWs) currently supports WINFOArtifact only!");
+        log.warn("This method (getWs) currently supports WINFOArtifact only!");
 
         return null;
     }
@@ -442,7 +442,7 @@
         River river = getRiver(flys);
 
         if (river == null) {
-            logger.debug("no river found");
+            log.debug("no river found");
             return null;
         }
 
@@ -450,20 +450,20 @@
         double[] dist = rangeAccess.getKmRange();
 
         if (dist == null) {
-            logger.debug("no range found");
+            log.debug("no range found");
             return null;
         }
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("Determine gauge for:");
-            logger.debug("... river: " + river.getName());
-            logger.debug("... distance: " + dist[0] + " - " + dist[1]);
+        if (log.isDebugEnabled()) {
+            log.debug("Determine gauge for:");
+            log.debug("... river: " + river.getName());
+            log.debug("... distance: " + dist[0] + " - " + dist[1]);
         }
 
         Gauge gauge = river.determineGauge(dist[0], dist[1]);
 
         String name = gauge != null ? gauge.getName() : "'n/a";
-        logger.debug("Found gauge: " + name);
+        log.debug("Found gauge: " + name);
 
         return gauge;
     }
@@ -506,7 +506,7 @@
         Matcher m = NUMBERS_PATTERN.matcher(wq.getName());
 
         if (m.matches()) {
-            logger.debug("Found a number.");
+            log.debug("Found a number.");
 
             String raw = m.group(1);
 
@@ -546,7 +546,7 @@
             namedMainValue = getNamedMainValue(winfo.getGauge(), v);
         }
         catch (NumberFormatException nfe) {
-            logger.warn("Cannot parse Double of: '" + parts[1] + "'");
+            log.warn("Cannot parse Double of: '" + parts[1] + "'");
             return name;
         }
 
@@ -588,7 +588,7 @@
             namedMainValue = getNamedMainValue(winfo.getGauge(), v);
         }
         catch (NumberFormatException nfe) {
-            logger.warn("Cannot parse Double of: '" + parts[1] + "'");
+            log.warn("Cannot parse Double of: '" + parts[1] + "'");
             return name;
         }
 
@@ -631,16 +631,16 @@
 
     public static String getNamedMainValue(Gauge gauge, double value) {
         List<MainValue> mainValues = gauge.getMainValues();
-        logger.debug("Search named main value for: " + value);
+        log.debug("Search named main value for: " + value);
 
         for (MainValue mv: mainValues) {
             if (mv.getValue().doubleValue() == value) {
-                logger.debug("Found named main value: " + mv.getMainValue().getName());
+                log.debug("Found named main value: " + mv.getMainValue().getName());
                 return mv.getMainValue().getName();
             }
         }
 
-        logger.debug("Did not find a named main value for: " + value);
+        log.debug("Did not find a named main value for: " + value);
         return null;
     }
 
@@ -755,7 +755,7 @@
             return diffs;
         }
         else {
-            logger.warn("Not a valid state for differences.");
+            log.warn("Not a valid state for differences.");
             return "";
         }
     }
@@ -772,7 +772,7 @@
         String[] splitted = raw != null ? raw.split(";") : null;
 
         if (splitted == null || splitted.length == 0) {
-            logger.warn("No integer values found in '" + raw + "'");
+            log.warn("No integer values found in '" + raw + "'");
             return new int[0];
         }
 
@@ -783,7 +783,7 @@
                 integers.add(Integer.parseInt(value));
             }
             catch (NumberFormatException nfe) {
-                logger.warn("Parsing integer failed: " + nfe);
+                log.warn("Parsing integer failed: " + nfe);
             }
         }
 
@@ -803,7 +803,7 @@
         String[] splitted = raw != null ? raw.split(";") : null;
 
         if (splitted == null || splitted.length == 0) {
-            logger.warn("No long values found in '" + raw + "'");
+            log.warn("No long values found in '" + raw + "'");
             return new long[0];
         }
 
@@ -814,7 +814,7 @@
                 longs.add(Long.valueOf(value));
             }
             catch (NumberFormatException nfe) {
-                logger.warn("Parsing long failed: " + nfe);
+                log.warn("Parsing long failed: " + nfe);
             }
         }
 
@@ -835,7 +835,7 @@
         String[] splitted = raw != null ? raw.split(";") : null;
 
         if (splitted == null || splitted.length == 0) {
-            logger.warn("No double values found in '" + raw + "'");
+            log.warn("No double values found in '" + raw + "'");
             return new double[0];
         }
 
@@ -846,7 +846,7 @@
                 doubles.add(Double.valueOf(value));
             }
             catch (NumberFormatException nfe) {
-                logger.warn("Parsing double failed: " + nfe);
+                log.warn("Parsing double failed: " + nfe);
             }
         }
 
@@ -866,17 +866,17 @@
 
         River river = getRiver(flys);
         if (river == null) {
-            logger.debug("getGauges: no river!");
+            log.debug("getGauges: no river!");
             return null;
         }
 
         RangeAccess rangeAccess = new RangeAccess(flys);
         double[] dist = rangeAccess.getKmRange();
         if (dist == null) {
-            logger.debug("getGauges: no dist!");
+            log.debug("getGauges: no dist!");
             return null;
         }
-        logger.debug("getGauges: " + dist[0] + " - " + dist[1]);
+        log.debug("getGauges: " + dist[0] + " - " + dist[1]);
 
         return river.determineGauges(dist[0], dist[1]);
     }
@@ -910,8 +910,8 @@
             return;
         }
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("currentKm = " + dKm);
+        if (log.isDebugEnabled()) {
+            log.debug("currentKm = " + dKm);
         }
         context.putContextValue(CURRENT_KM, dKm);
     }

http://dive4elements.wald.intevation.org