Sfoglia il codice sorgente

Closer to immutability

peter_backlund 18 anni fa
parent
commit
a25cce26dc

+ 3
- 3
dddsample/src/main/java/se/citerus/dddsample/application/HandlingEventRegistrationAttempt.java Vedi File

@@ -13,7 +13,7 @@ import java.util.Date;
13 13
  * registration attempts to proper the registration procedure.
14 14
  *  
15 15
  */
16
-public class HandlingEventRegistrationAttempt implements Serializable {
16
+public final class HandlingEventRegistrationAttempt implements Serializable {
17 17
 
18 18
   private final Date registrationDate;
19 19
   private final Date date;
@@ -37,7 +37,7 @@ public class HandlingEventRegistrationAttempt implements Serializable {
37 37
   }
38 38
 
39 39
   public Date getDate() {
40
-    return date;
40
+    return new Date(date.getTime());
41 41
   }
42 42
 
43 43
   public TrackingId getTrackingId() {
@@ -57,6 +57,6 @@ public class HandlingEventRegistrationAttempt implements Serializable {
57 57
   }
58 58
 
59 59
   public Date getRegistrationDate() {
60
-    return registrationDate;
60
+    return new Date(registrationDate.getTime());
61 61
   }
62 62
 }