# HG changeset patch # User Sascha L. Teichmann # Date 1343512095 0 # Node ID b1912514e0f57a57acac40064abe5b4f3e305a83 # Parent 9b356ed244117122e6e187cbfa413726760691ff s/container.size() == 0/container.isEmpty()/ flys-artifacts/trunk@5149 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java: diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.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 list = state.getOutputs(); - if (list == null || list.size() == 0) { + if (list == null || list.isEmpty()) { logger.debug("-> No output modes for this state."); continue; } List fs = facets.get(stateId); - if (fs == null || fs.size() == 0) { + if (fs == null || fs.isEmpty()) { logger.debug("No facets found."); continue; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/artifacts/ChartArtifact.java --- 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 list = state.getOutputs(); - if (list == null || list.size() == 0) { + if (list == null || list.isEmpty()) { logger.debug("-> No output modes for this state."); continue; } List fs = facets.get(stateId); - if (fs == null || fs.size() == 0) { + if (fs == null || fs.isEmpty()) { logger.debug("No facets for previous state found."); continue; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java --- 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 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 fs = facets.get(stateId); - if (fs == null || fs.size() == 0) { + if (fs == null || fs.isEmpty()) { if (debug) { log.debug("No facets found."); } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/artifacts/MapArtifact.java --- 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 list = state.getOutputs(); - if (list == null || list.size() == 0) { + if (list == null || list.isEmpty()) { logger.debug("-> No output modes for this state."); continue; } List fs = facets.get(stateId); - if (fs == null || fs.size() == 0) { + if (fs == null || fs.isEmpty()) { logger.debug("No facets for previous state found."); continue; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java --- 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 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 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 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; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionAttribute.java --- 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 getFacets() { List allFacets = new ArrayList(); - 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 facets) { - if (facets == null || facets.size() == 0) { + if (facets == null || facets.isEmpty()) { logger.warn("Tried to append 0 Facets."); return; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java --- 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; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/exports/ChartGenerator.java --- 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; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/exports/CrossSectionGenerator.java --- 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 zones = (List) o; - if (zones == null || zones.size() == 0) { + if (zones == null || zones.isEmpty()) { logger.warn("CrossSectionGenerator.doHYK: empty zone list received."); return; } diff -r 9b356ed24411 -r b1912514e0f5 flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java --- 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; }