Procházet zdrojové kódy

Use Location.UNKNOWN to signal unknown location instead of null

peter_backlund před 18 roky
rodič
revize
130d3bfd0c

+ 2
- 2
dddsample/src/main/java/se/citerus/dddsample/util/LocationsImporter.java Zobrazit soubor

@@ -48,7 +48,7 @@ public class LocationsImporter implements ServletContextListener {
48 48
     while (iterator.hasNext()) {
49 49
       String line = iterator.nextLine();
50 50
       Location location = parseLocation(line);
51
-      if (location != null) {
51
+      if (location != Location.UNKNOWN) {
52 52
           session.save(location);
53 53
           if (insertCount % BATCH_SIZE == 0) {
54 54
             session.flush();
@@ -70,7 +70,7 @@ public class LocationsImporter implements ServletContextListener {
70 70
       UnLocode unlocode = new UnLocode(countryCode, locationCode);
71 71
       return new Location(unlocode, name);
72 72
     } else {
73
-      return null;
73
+      return Location.UNKNOWN;
74 74
     }
75 75
   }
76 76