[LIB-5] Collection empty objects,reporting and serializable
[snooker-score-api.git] / src / main / java / org / hedgecode / snooker / SnookerScoreApp.java
index e81bc6e..286c966 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker;
 
+import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 
 import org.hedgecode.snooker.api.APIException;
@@ -45,7 +46,7 @@ public final class SnookerScoreApp {
     private static final String UPCOMING_EVENTS = "  Upcoming Snooker Events:  ";
     private static final String INDENT = "     ";
 
-    private static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy");
+    private static final String DATE_FORMAT = "dd.MM.yyyy";
 
     private static final int UPCOMING_COUNT = 5;
 
@@ -86,10 +87,11 @@ public final class SnookerScoreApp {
     }
 
     private static void printEvent(Event event) {
+        final DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
         System.out.println(
                 INDENT  + event.name()
-                        + " [" + DATE_FORMAT.format(event.startDate())
-                        + " - " + DATE_FORMAT.format(event.endDate()) + "]"
+                        + " [" + dateFormat.format(event.startDate())
+                        + " - " + dateFormat.format(event.endDate()) + "]"
                         + " (" + event.country() + ", " + event.city() + ")"
         );
     }