diff --git a/src/effectivejava/chapter12/item90/Period.java b/src/effectivejava/chapter12/item90/Period.java index 71aaf712..07df3731 100644 --- a/src/effectivejava/chapter12/item90/Period.java +++ b/src/effectivejava/chapter12/item90/Period.java @@ -43,6 +43,10 @@ private static class SerializationProxy implements Serializable { private static final long serialVersionUID = 234098243823485285L; // Any number will do (Item 87) + + private Object readResolve() { + return new Period(start, end); // Uses public constructor + } } // writeReplace method for the serialization proxy pattern