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="da6f6717bf9594f7-5eefce8e-450f4d31-878dbcec-072915573ff3041112c73521"><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="93ef76ceca34ab94-540e2ba0-453b4042-afb5b460-29672d63069870e837c9b60b"><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="47e987ca3d1fc115-65d7ca0a-4f92433b-89709b01-ed63b7f58051664b36336e19"><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>

...