# HG changeset patch # User Sascha L. Teichmann # Date 1340010965 0 # Node ID 4a76da1331446f864bace1d632487966064cd520 # Parent ba7df29264cd8e2b3e7a1e59ff3e9bdf71bcb344 Removed repeated x.size() calls from for loops. flys-artifacts/trunk@4684 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/ChangeLog Mon Jun 18 09:16:05 2012 +0000 @@ -1,3 +1,15 @@ +2012-06-18 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/map/PrintMap.java, + src/main/java/de/intevation/flys/artifacts/states/SoundingsSelect.java, + src/main/java/de/intevation/flys/artifacts/states/SQRelation.java, + src/main/java/de/intevation/flys/artifacts/states/DischargeState.java, + src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java, + src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java, + src/main/java/de/intevation/flys/exports/XYChartGenerator.java, + src/main/java/de/intevation/flys/collections/CollectionDescriptionHelper.java: + Removed repeated x.size() calls from for loops. + 2012-06-18 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/model/fixings/FixDerivateFacet.java, diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java Mon Jun 18 09:16:05 2012 +0000 @@ -186,7 +186,7 @@ logger.debug("Groups for connection string: " + m.groupCount()); int groups = m.groupCount(); - for (int i = 0; i <= m.groupCount(); i++) { + for (int i = 0; i <= groups; i++) { logger.debug("Group " + i + ": " + m.group(i)); } diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/artifacts/map/PrintMap.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/map/PrintMap.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/map/PrintMap.java Mon Jun 18 09:16:05 2012 +0000 @@ -118,7 +118,7 @@ List layers = capabilities.getLayerList(); WMSMapLayer[] wmslayers = new WMSMapLayer[layers.size()]; - for (int i = 0; i < layers.size(); i++) { + for (int i = 0, L = layers.size(); i < L; i++) { Layer l = layers.get(i); System.out.println(" -> add layer: " + l); diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeState.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeState.java Mon Jun 18 09:16:05 2012 +0000 @@ -59,7 +59,7 @@ KVP[] kvp = new KVP[zones.size()]; - for (int i = 0; i < zones.size(); i++) { + for (int i = 0, Z = zones.size(); i < Z; i++) { DischargeZone zone = zones.get(i); String lower = zone.getLowerDischarge(); diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SQRelation.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SQRelation.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SQRelation.java Mon Jun 18 09:16:05 2012 +0000 @@ -82,7 +82,7 @@ container.add(new SQMeasurementFacet(0, SQ_A_MEASUREMENT, "TODO")); container.add(new SQCurveFacet(0, SQ_A_CURVE, "TODO")); - for (int i = 0; i < sqr[0].getOutliersCount(); i++) { + for (int i = 0, C = sqr[0].getOutliersCount(); i < C; i++) { container.add(new SQOutlierFacet( 0, i, diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SoundingsSelect.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SoundingsSelect.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/SoundingsSelect.java Mon Jun 18 09:16:05 2012 +0000 @@ -76,7 +76,7 @@ BedHeightSingle.getBedHeightSingles(river, kmLo, kmHi); if (singles != null) { - for (int i = 0; i < singles.size(); i++) { + for (int i = 0, S = singles.size(); i < S; i++) { BedHeightSingle s = singles.get(i); String id = PREFIX_SINGLE + s.getId(); @@ -98,7 +98,7 @@ BedHeightEpoch.getBedHeightEpochs(river, kmLo, kmHi); if (epochs != null) { - for (int i = 0; i < epochs.size(); i++) { + for (int i = 0, E = epochs.size(); i < E; i++) { BedHeightEpoch e = epochs.get(i); String id = PREFIX_EPOCH + e.getId(); diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionDescriptionHelper.java --- a/flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionDescriptionHelper.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/CollectionDescriptionHelper.java Mon Jun 18 09:16:05 2012 +0000 @@ -187,7 +187,7 @@ if (dataNodes != null) { Document doc = ci.getOwnerDocument(); - for (int i = 0; i < dataNodes.getLength(); i++) { + for (int i = 0, D = dataNodes.getLength(); i < D; i++) { dataNode.appendChild(doc.importNode(dataNodes.item(i), true)); } } diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java Mon Jun 18 09:16:05 2012 +0000 @@ -496,7 +496,7 @@ try { JSONArray points = new JSONArray((String) o); - for (int i = 0; i < points.length(); i++) { + for (int i = 0, P = points.length(); i < P; i++) { JSONArray array = points.getJSONArray(i); double x = array.getDouble(0); double y = array.getDouble(1); @@ -519,7 +519,7 @@ TimeSeriesCollection tsc = new TimeSeriesCollection(); tsc.addSeries(series); // Add Annotations. - for (int i = 0; i < series.getItemCount(); i++) { + for (int i = 0, S = series.getItemCount(); i < S; i++) { double x = tsc.getXValue(0, i); double y = tsc.getYValue(0, i); xy.add(new CollisionFreeXYTextAnnotation( diff -r ba7df29264cd -r 4a76da133144 flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Jun 18 08:55:51 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java Mon Jun 18 09:16:05 2012 +0000 @@ -283,7 +283,7 @@ */ public void debugDatasets(XYPlot plot) { logger.debug("Number of datasets: " + plot.getDatasetCount()); - for (int i = 0; i < plot.getDatasetCount(); i++) { + for (int i = 0, P = plot.getDatasetCount(); i < P; i++) { if (plot.getDataset(i) == null) { logger.debug("Dataset #" + i + " is null"); continue; @@ -303,7 +303,7 @@ */ public void debugAxis(XYPlot plot) { logger.debug("..............."); - for (int i = 0; i < plot.getRangeAxisCount(); i++) { + for (int i = 0, P = plot.getRangeAxisCount(); i < P; i++) { if (plot.getRangeAxis(i) == null) logger.debug("Range-Axis #" + i + " == null"); else { @@ -1216,7 +1216,7 @@ try { JSONArray points = new JSONArray((String) o); - for (int i = 0; i < points.length(); i++) { + for (int i = 0, P = points.length(); i < P; i++) { JSONArray array = points.getJSONArray(i); double x = array.getDouble(0); double y = array.getDouble(1);