changeset 3555:b1912514e0f5

s/container.size() == 0/container.isEmpty()/ flys-artifacts/trunk@5149 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 28 Jul 2012 21:48:15 +0000
parents 9b356ed24411
children afc7bfb4800b
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/MapArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java
diffstat 11 files changed, 39 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/ChangeLog	Sat Jul 28 21:48:15 2012 +0000
@@ -1,3 +1,17 @@
+2012-07-28	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java,
+	  src/main/java/de/intevation/flys/exports/ChartGenerator.java,
+	  src/main/java/de/intevation/flys/themes/ThemeFactory.java,
+	  src/main/java/de/intevation/flys/collections/CollectionAttribute.java,
+	  src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java,
+	  src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/ChartArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java,
+	  src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/MapArtifact.java:
+	  s/container.size() == 0/container.isEmpty()/
+
 2012-07-28	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java	Sat Jul 28 21:48:15 2012 +0000
@@ -160,13 +160,13 @@
             DefaultState state = (DefaultState) engine.getState(stateId);
 
             List<Output> list = state.getOutputs();
-            if (list == null || list.size() == 0) {
+            if (list == null || list.isEmpty()) {
                 logger.debug("-> No output modes for this state.");
                 continue;
             }
 
             List<Facet> fs = facets.get(stateId);
-            if (fs == null || fs.size() == 0) {
+            if (fs == null || fs.isEmpty()) {
                 logger.debug("No facets found.");
                 continue;
             }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java	Sat Jul 28 21:48:15 2012 +0000
@@ -95,14 +95,14 @@
             DefaultState state = (DefaultState) engine.getState(stateId);
 
             List<Output> list = state.getOutputs();
-            if (list == null || list.size() == 0) {
+            if (list == null || list.isEmpty()) {
                 logger.debug("-> No output modes for this state.");
                 continue;
             }
 
             List<Facet> fs = facets.get(stateId);
 
-            if (fs == null || fs.size() == 0) {
+            if (fs == null || fs.isEmpty()) {
                 logger.debug("No facets for previous state found.");
                 continue;
             }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Sat Jul 28 21:48:15 2012 +0000
@@ -1185,7 +1185,7 @@
         }
 
         List<Output> list = state.getOutputs();
-        if (list == null || list.size() == 0) {
+        if (list == null || list.isEmpty()) {
             if (debug) {
                 log.debug("-> No output modes for this state.");
             }
@@ -1196,7 +1196,7 @@
 
         List<Facet> fs = facets.get(stateId);
 
-        if (fs == null || fs.size() == 0) {
+        if (fs == null || fs.isEmpty()) {
             if (debug) {
                 log.debug("No facets found.");
             }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MapArtifact.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MapArtifact.java	Sat Jul 28 21:48:15 2012 +0000
@@ -98,14 +98,14 @@
             DefaultState state = (DefaultState) engine.getState(stateId);
 
             List<Output> list = state.getOutputs();
-            if (list == null || list.size() == 0) {
+            if (list == null || list.isEmpty()) {
                 logger.debug("-> No output modes for this state.");
                 continue;
             }
 
             List<Facet> fs = facets.get(stateId);
 
-            if (fs == null || fs.size() == 0) {
+            if (fs == null || fs.isEmpty()) {
                 logger.debug("No facets for previous state found.");
                 continue;
             }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Sat Jul 28 21:48:15 2012 +0000
@@ -122,7 +122,7 @@
     ) {
         FLYSArtifact flys  = (FLYSArtifact) owner;
         List<Facet> facets = flys.getFacets();
-        if (facets == null || facets.size() == 0) {
+        if (facets == null || facets.isEmpty()) {
             logger.warn("No facets for '" + OUTPUT_NAME + "' given!");
             return;
         }
@@ -411,7 +411,7 @@
             "barriers", srs, Geometry.class);
 
         List<SimpleFeature> features = GeometryUtils.parseGeoJSON(geoJSON, ft);
-        if (features == null || features.size() == 0) {
+        if (features == null || features.isEmpty()) {
             logger.debug("No barrier features extracted.");
             return;
         }
@@ -604,7 +604,7 @@
         String srs     = "EPSG:" + srid;
 
         List<RiverAxis> axes = RiverAxis.getRiverAxis(river);
-        if (axes == null || axes.size() == 0) {
+        if (axes == null || axes.isEmpty()) {
             logger.warn("Could not find river axis for: '" + river + "'");
             return;
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java	Sat Jul 28 21:48:15 2012 +0000
@@ -183,7 +183,7 @@
             return null;
         }
 
-        if (outputMap == null || outputMap.size() == 0) {
+        if (outputMap == null || outputMap.isEmpty()) {
             logger.warn("Tried to retrieve Output, but no Outputs existing.");
             return null;
         }
@@ -217,7 +217,7 @@
     public List<Facet> getFacets() {
         List<Facet> allFacets = new ArrayList<Facet>();
 
-        if (outputMap == null || outputMap.size() == 0) {
+        if (outputMap == null || outputMap.isEmpty()) {
             logger.warn("No Outputs existing.");
             return allFacets;
         }
@@ -233,7 +233,7 @@
 
 
     protected void appendOutputs(Element root) {
-        if (outputMap == null || outputMap.size() == 0) {
+        if (outputMap == null || outputMap.isEmpty()) {
             logger.warn("No outputs to append.");
             return;
         }
@@ -281,7 +281,7 @@
 
 
     protected void appendFacets(Element root, List<Facet> facets) {
-        if (facets == null || facets.size() == 0) {
+        if (facets == null || facets.isEmpty()) {
             logger.warn("Tried to append 0 Facets.");
             return;
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java	Sat Jul 28 21:48:15 2012 +0000
@@ -252,7 +252,7 @@
             ? attribute.getOutputs()
             : null;
 
-        if (outputMap == null || outputMap.size() == 0) {
+        if (outputMap == null || outputMap.isEmpty()) {
             log.debug("No Output Settings check necessary.");
             return modified;
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java	Sat Jul 28 21:48:15 2012 +0000
@@ -423,7 +423,7 @@
     protected void addAnnotationsToRenderer(XYPlot plot) {
         logger.debug("addAnnotationsToRenderer");
 
-        if (annotations == null || annotations.size() == 0) {
+        if (annotations == null || annotations.isEmpty()) {
             logger.debug("addAnnotationsToRenderer: no annotations.");
             return;
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java	Sat Jul 28 21:48:15 2012 +0000
@@ -375,7 +375,7 @@
 
         List<HYKFactory.Zone> zones = (List<HYKFactory.Zone>) o;
 
-        if (zones == null || zones.size() == 0) {
+        if (zones == null || zones.isEmpty()) {
             logger.warn("CrossSectionGenerator.doHYK: empty zone list received.");
             return;
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java	Sat Jul 28 20:58:42 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java	Sat Jul 28 21:48:15 2012 +0000
@@ -74,7 +74,10 @@
         String output,
         String groupName)
     {
-        logger.debug("Search theme for: " + name + " - pattern: " + pattern);
+        if (logger.isDebugEnabled()) {
+            logger.debug(
+                "Search theme for: " + name + " - pattern: " + pattern);
+        }
 
         if (c == null || name == null) {
             logger.warn("Cannot search for theme.");
@@ -92,8 +95,9 @@
 
         ThemeGroup group = null;
         for (ThemeGroup tg: tgs) {
-            if(tg.getName().equals(groupName)) {
+            if (tg.getName().equals(groupName)) {
                 group = tg;
+                break;
             }
         }
 
@@ -105,7 +109,7 @@
 
         FLYSArtifact artifact = (FLYSArtifact) c.get(FLYSContext.ARTIFACT_KEY);
 
-        if (map == null || map.size() == 0 || t == null || t.size() == 0) {
+        if (map == null || map.isEmpty() || t == null || t.isEmpty()) {
             logger.warn("No mappings or themes found. Cannot retrieve theme!");
             return null;
         }

http://dive4elements.wald.intevation.org