Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
There is no need to copy immutable subobjects. Also, avoid using the subobject's {{clone()}} method because it can be overridden when the subobject's class is not final and produces only a shallow copy. The references to the subobjects themselves must be nonfinal so that defensive copying can occur. It is also inadvisable to use the {{writeUnshared()}} and {{readUnshared()}} methods as an alternative \[[Bloch 2008|AA. Bibliography#BlochReferences#Bloch 08]\].

Risk Assessment

Failure to defensively copy mutable components during deserialization can violate the immutability contract of an object.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="48bb4ac7e598c847-24ac282c-40a24ab4-8aff9e9f-a54ddd699519cf36b7ee658e"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API 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="8122c7feac446c7d-8d5f6f3a-44cd4195-ae6dbd6d-68792b5fccb7639304b42a0f"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. Bibliography#Bloch 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="5d6ea998ac44234f-75406453-497e47ca-9862ad70-4061825799c62b54835d4380"><ac:plain-text-body><![CDATA[

[[Sun 2006

AA. Bibliography#Sun References#Sun 06]]

Serialization Specification, A.6, Guarding Unshared Deserialized Objects

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

...