Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix stupid disordered initialization bug.

  • Loading branch information...
commit bae0fc10e38ebe8f1242264473665cd5067d9b33 1 parent b6e9b50
Israel Saeta Pérez authored
Showing with 7 additions and 6 deletions.
  1. +2 −2 CitiesDeserializer.java
  2. +5 −4 IntegrationTest.java
4 CitiesDeserializer.java
View
@@ -12,16 +12,16 @@
public CitiesDeserializer(Iterator<HashMap<String,String>> itr, CitiesController cc) {
this.itr = itr;
this.cc = cc;
+ }
+ public void generate() {
// hashset for fast searching
cityToponymCodes = new HashSet<String>();
Iterator<HashMap<String,String>> ttItr = cc.getToponymTypesIterator();
while (ttItr.hasNext()) {
cityToponymCodes.add(ttItr.next().get("code"));
}
- }
- public void generate() {
while (itr.hasNext()) {
HashMap<String,String> currentMap = itr.next();
9 IntegrationTest.java
View
@@ -37,7 +37,7 @@ public void setUp() throws Exception {
citiesc = new CitiesController(ds);
linec = new LineController(ds);
- File fFronteres = new File("Fronteres_OurEurope.txt");
+ File fFronteres = new File("Fronteres_all.txt");
//File fFronteres = new File("Fronteres_A.txt");
BordersFileParser parserFronteres = new BordersFileParser(fFronteres);
Iterator<HashMap<String,String>> itrFronteres = parserFronteres.getIterator();
@@ -53,12 +53,13 @@ public void setUp() throws Exception {
ToponymsFileParser parserToponyms = new ToponymsFileParser(fToponyms);
Iterator<HashMap<String,String>> itrToponyms = parserToponyms.getIterator();
- cd = new CitiesDeserializer(itrToponyms, citiesc);
bpd = new BorderPointsDeserializer(itrFronteres, countryc, zonesc);
- ttd = new ToponymTypesDeserializer(itrTypes, citiesc);
+ bpd.generate();
+ ttd = new ToponymTypesDeserializer(itrTypes, citiesc);
ttd.generate();
- bpd.generate();
+
+ cd = new CitiesDeserializer(itrToponyms, citiesc);
cd.generate();
}
Please sign in to comment.
Something went wrong with that request. Please try again.