...
Fields declared static final
are also safe for multithreaded use. (See rule "TSM03-J. Do not publish partially initialized objects.") However, remember that simply changing the modifier to final
might not prevent attackers from indirectly retrieving an incorrect value from the static
final
variable before its initialization. (See rule "DCL12-J. Prevent class initialization cycles" for more information.) Furthermore, individual members of the referenced object can also be changed if the object itself is mutable. (See rule "OBJ02-J. Never conflate immutability of a reference with that of the referenced object.")
It is also permissible to use a wrapper method to retrieve the value of m_functions
. This has encapsulation advantages because it permits m_functions
to be declared private
. See rule "OBJ01-J. Declare data members as private and provide accessible wrapper methods" for more information.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b3e82a4fbc5288e1-37fa2c3a-4da843fc-a21981c6-49c12778982d2e16de5b698e"><ac:plain-text-body><![CDATA[ | [[FT 2008 | AA. Bibliography#FT 08]] | Function Table Class Function Table | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="83321ee7910bae4e-8be801f4-49ce46c8-beca9ea8-14a3933de03654a260fdc0b9"><ac:plain-text-body><![CDATA[ | [[Gong 2003 | AA. Bibliography#Gong 03]] | 9.3 Static Fields | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="39416776f3b28d36-afdf5046-49e841c3-bd7ba1e9-779165c9e35628e10ca9b79d"><ac:plain-text-body><![CDATA[ | [[Nisewanger 2007 | AA. Bibliography#Nisewanger 07]] | Antipattern 5, Misusing Public Static Variables | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="064368678aa9ce7b-2a527432-4a82460b-9c5b9c7d-16088b35e560d77d6bfc061e"><ac:plain-text-body><![CDATA[ | [[Sterbenz 2006 | AA. Bibliography#Sterbenz 06]] | Antipattern 5, Misusing Public Static Variables | ]]></ac:plain-text-body></ac:structured-macro> |
...