Skip to content
Snippets Groups Projects
Commit b123d55b authored by Peter Alexander's avatar Peter Alexander
Browse files

Skip countries not in countrygroup file

parent d0120612
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import java.util.stream.Collectors;
import ac.ed.lurg.ModelConfig;
import ac.ed.lurg.demand.BaseConsumpManager;
import ac.ed.lurg.utils.CollectionHelper;
import ac.ed.lurg.utils.LogWriter;
import ac.ed.lurg.utils.StringTabularReader;
public class CompositeCountryManager {
......@@ -37,8 +38,13 @@ public class CompositeCountryManager {
private String getCountryGroup(SingleCountry aCountry) {
Map<String, String> queryMap = new HashMap<String, String>();
queryMap.put("Country", aCountry.getCountryName());
Map<String, String> row = countryGroups.querySingle(queryMap);
return row.get("PlumGroup");
try {
Map<String, String> row = countryGroups.querySingle(queryMap);
return row.get("PlumGroup");
} catch (Exception e) {
LogWriter.println("Can't finding country group for " + aCountry.getCountryName() + " so skipping");
return null;
}
}
......@@ -57,7 +63,8 @@ public class CompositeCountryManager {
else
cc = getForName(c.getCountryName(),c.getRegion());
mapFromSingleCountry.put(c, cc);
if (cc != null)
mapFromSingleCountry.put(c, cc);
}
mapFromCompositeCountry = CollectionHelper.invertMap(mapFromSingleCountry);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment