Skip to content
Snippets Groups Projects
Commit 682853a6 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Bugfix avoiding concurrentmodificationexception

parent aaddbf15
Branches
Tags
No related merge requests found
......@@ -207,6 +207,15 @@ public class OatFloweringModel extends I18nImpl implements Model{
ObjectMapper mapper = new ObjectMapper();
List<WeatherObservation> observations = mapper.convertValue(config.getConfigParameter("observations"), new TypeReference<List<WeatherObservation>>(){});
// Must be complete set of daily mean temperatures
WeatherUtil wUtil = new WeatherUtil();
Date potentialHole = wUtil.findFirstHoleInObservationSeries(observations, WeatherObservation.LOG_INTERVAL_ID_1D, OatFloweringModel.DEFAULT_TIME_ZONE);
if(potentialHole != null)
{
throw new ConfigValidationException("Hole found in temperature series at = " + potentialHole);
}
for(WeatherObservation o:observations)
{
switch(o.getElementMeasurementTypeId())
......@@ -221,17 +230,9 @@ public class OatFloweringModel extends I18nImpl implements Model{
// TODO: Throw validation error?
break;
}
// Must be complete set of daily mean temperatures
WeatherUtil wUtil = new WeatherUtil();
Date potentialHole = wUtil.findFirstHoleInObservationSeries(observations, WeatherObservation.LOG_INTERVAL_ID_1D, OatFloweringModel.DEFAULT_TIME_ZONE);
if(potentialHole != null)
{
throw new ConfigValidationException("Hole found in temperature series at = " + potentialHole);
}
}
if(config.getConfigParameter("dateOfSowing") != null)
{
this.dateOfSowing = mapper.convertValue(config.getConfigParameter("dateOfSowing"), new TypeReference<Date>(){});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment