Versions Compared

Key

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

...

Classes that have public setter methods must follow the related advice found in rule "FIO00OBJ06-J. Defensively copy mutable inputs and mutable internal components." Note that setter methods can (and usually should) perform input validation and sanitization before setting internal fields.

...

When a hash table contains references to mutable data such as a series of Date objects, each of those objects must also be copied by using a copy constructor or method. For further details, refer to rules "FIO00OBJ06-J. Defensively copy mutable inputs and mutable internal components" and "OBJ08OBJ04-J. Provide mutable classes with copy functionality to allow passing instances to untrusted code safely."

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="423b219f6864dede-ac38b2bc-4507427f-95268a7a-c4ca38519c6b9fb7cf2fc08a"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API 06]]

[method clone()

http://java.sun.com/javase/6/docs/api/java/lang/Object.html#clone()]

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6a4c36b04c98125b-76188028-4d874d01-bdb4a450-00d6982957f9da420b84ccd5"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. Bibliography#Bloch 08]]

Item 39: Make defensive copies when needed

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ba4c3414de56d6ad-3f5062fe-498a4655-84f9994c-f96318693d0247503be46702"><ac:plain-text-body><![CDATA[

[[Goetz 2006

AA. Bibliography#Goetz 06]]

3.2. Publication and Escape: Allowing Internal Mutable State to Escape

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2aafeca35bb4d777-f9fa79f1-44094360-875298a7-a7773f22166dcfd00c5b098c"><ac:plain-text-body><![CDATA[

[[Gong 2003

AA. Bibliography#Gong 03]]

9.4 Private Object State and Object Immutability

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0f433ef88e64b1ca-8a9923fd-4b304d7a-887284a3-a692429390e740789880fd0e"><ac:plain-text-body><![CDATA[

[[Haggar 2000

AA. Bibliography#Haggar 00]]

[Practical Java Praxis 64: Use clone for Immutable Objects When Passing or Receiving Object References to Mutable Objects

http://www.informit.com/articles/article.aspx?p=20530]

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1f97d242f7ba4be2-0165db56-4d854055-93df8816-1a7e2cd18e358ddfc2cdbb99"><ac:plain-text-body><![CDATA[

[[Security 2006

AA. Bibliography#Security 06]]

 

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

...