--- a/jdk/src/share/classes/java/time/chrono/MinguoChronology.java Fri Sep 06 14:18:06 2013 -0700
+++ b/jdk/src/share/classes/java/time/chrono/MinguoChronology.java Wed Sep 11 10:16:21 2013 -0400
@@ -56,6 +56,8 @@
*/
package java.time.chrono;
+import java.io.InvalidObjectException;
+import java.io.ObjectStreamException;
import static java.time.temporal.ChronoField.PROLEPTIC_MONTH;
import static java.time.temporal.ChronoField.YEAR;
@@ -333,4 +335,29 @@
return (MinguoDate) super.resolveDate(fieldValues, resolverStyle);
}
+ //-----------------------------------------------------------------------
+ /**
+ * Writes the Chronology using a
+ * <a href="../../../serialized-form.html#java.time.chrono.Ser">dedicated serialized form</a>.
+ * @serialData
+ * <pre>
+ * out.writeByte(1); // identifies a Chronology
+ * out.writeUTF(getId());
+ * </pre>
+ *
+ * @return the instance of {@code Ser}, not null
+ */
+ @Override
+ Object writeReplace() {
+ return super.writeReplace();
+ }
+
+ /**
+ * Defend against malicious streams.
+ * @return never
+ * @throws InvalidObjectException always
+ */
+ private Object readResolve() throws InvalidObjectException {
+ throw new InvalidObjectException("Deserialization via serialization delegate");
+ }
}