Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: method name corrected.

...

Code Block
bgColor#ccccff
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
  ObjectInputStream.GetField fields = ois.readFields();
  Date inDate = (Date) fields.getFieldget("date", epoch);
  // Defensively copy the mutable component
  date = new Date(inDate.getTime());
  // Perform validation if necessary
}

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b64f118d2431ed9f-39de3af5-42434a09-806bbc39-014ecdef5848c7cb44035295"><ac:plain-text-body><![CDATA[

[[API 2006

AA. References#API 06]]

 

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="98d22dabb79c03ed-915971c0-428e4592-84ad80c0-775d14cf18fa76b297fae804"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. References#Bloch 08]]

Item 76, Write readObject methods defensively

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6fbe25dc73208169-2bf8aa20-482d4954-9e46a1e8-db3e4f8a060a5b3f5e99a00b"><ac:plain-text-body><![CDATA[

[[Sun 2006

AA. References#Sun 06]]

Serialization Specification, A.6, Guarding Unshared Deserialized Objects

]]></ac:plain-text-body></ac:structured-macro>

...