Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelState.java @ 6510:1e6bd2831280
artifacts: Desktop-FLYS conform official line messages in error reports.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 28 Jun 2013 20:20:14 +0200 |
parents | 7cb247824ed1 |
children | 12d9c5a430c5 |
comparison
equal
deleted
inserted
replaced
6508:b2eab164a441 | 6510:1e6bd2831280 |
---|---|
6 * documentation coming with Dive4Elements River for details. | 6 * documentation coming with Dive4Elements River for details. |
7 */ | 7 */ |
8 | 8 |
9 package org.dive4elements.river.artifacts.states; | 9 package org.dive4elements.river.artifacts.states; |
10 | 10 |
11 import java.util.Date; | |
11 import java.util.List; | 12 import java.util.List; |
12 | 13 |
13 import org.apache.log4j.Logger; | 14 import org.apache.log4j.Logger; |
14 | 15 |
15 import org.dive4elements.artifactdatabase.state.Facet; | 16 import org.dive4elements.artifactdatabase.state.Facet; |
123 if (!ols.isEmpty()) { | 124 if (!ols.isEmpty()) { |
124 for (OfficialLineFinder.ValueRange ol: ols) { | 125 for (OfficialLineFinder.ValueRange ol: ols) { |
125 report.addProblem(Resources.format( | 126 report.addProblem(Resources.format( |
126 cc.getMeta(), | 127 cc.getMeta(), |
127 "official.line.found", | 128 "official.line.found", |
128 "Found official line for {0}.", | 129 "Found official line for {0} from year {1,date,yyyy} from {2}.", |
129 ol.getName())); | 130 ol.getName(), nn(ol.getDate()), nn(ol.getSource()))); |
130 } | 131 } |
131 } | 132 } |
132 | 133 |
133 if (report.hasProblems()) { | 134 if (report.hasProblems()) { |
134 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id)); | 135 facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id)); |
135 } | 136 } |
136 | 137 |
137 return res; | 138 return res; |
138 } | 139 } |
139 | 140 |
141 private static final String nn(String s) { | |
142 return s != null ? s : ""; | |
143 } | |
144 | |
145 private static final Date nn(Date d) { | |
146 return d != null ? d : new Date(); | |
147 } | |
140 | 148 |
141 /** | 149 /** |
142 * @param context Ignored. | 150 * @param context Ignored. |
143 */ | 151 */ |
144 @Override | 152 @Override |