Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadExporter.java @ 8136:cda45ed151ed
Fix exporter loops
The one loop did not increase the count. The other did not handle null gracefully.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 25 Aug 2014 20:12:11 +0200 |
parents | dfcc96deebd8 |
children | ce35bdf3d750 |
comparison
equal
deleted
inserted
replaced
8135:05aca5659f32 | 8136:cda45ed151ed |
---|---|
103 /* The result is ordered by the peridods. For each period there is | 103 /* The result is ordered by the peridods. For each period there is |
104 * then a map of km - fractions pairs which are the actual result. */ | 104 * then a map of km - fractions pairs which are the actual result. */ |
105 | 105 |
106 TreeMap <String, TreeMap <Double, Double[]>> result_map = | 106 TreeMap <String, TreeMap <Double, Double[]>> result_map = |
107 new TreeMap<String, TreeMap<Double, Double[]>>(); | 107 new TreeMap<String, TreeMap<Double, Double[]>>(); |
108 int i = 0; | 108 for (int i = 0; i < FRACTION_ORDER.length; i++) { |
109 for (String name: FRACTION_ORDER) { | 109 String name = FRACTION_ORDER[i]; |
110 for (Fraction fract: result.getFractionsByName(name)) { | 110 List<Fraction> fractions = result.getFractionsByName(name); |
111 if (fractions == null) { | |
112 continue; | |
113 } | |
114 for (Fraction fract: fractions) { | |
111 String period = fract.getPeriod(); | 115 String period = fract.getPeriod(); |
112 TreeMap<Double, Double[]> cur_map; | 116 TreeMap<Double, Double[]> cur_map; |
113 if (result_map.containsKey(period)) { | 117 if (result_map.containsKey(period)) { |
114 cur_map = result_map.get(period); | 118 cur_map = result_map.get(period); |
115 } else { | 119 } else { |