Versions Compared

Key

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

...

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.")

...

MITRE CWE

CWE-582 "Array Declared Public, Final, and Static,"

 

CWE-493 "Critical Public Variable Without Final Modifier"

 

CWE-500 "Public Static Field Not Marked Final"

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ecce731233449f74-5f55bf05-4ae04abe-85a2afca-b5e26c8c75e0b9ce3fcd464f"><ac:plain-text-body><![CDATA[

[[SCG 2007

AA. Bibliography#SCG 07]]

Guideline 3.1, Treat public static fields as constants

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

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e5cf7e613cec54f4-3b283529-4c1b40f2-9cfbaa56-70cafb79f78168d26a0af81d"><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="b5cbf77edafe0f58-ccecbbb3-40564ca4-a30983b4-7d5330e61d40424d833d09b9"><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="7742905b6ad9bbbd-4ed0b024-4af84165-86d4b03a-965b97104c278497dbba2add"><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="f3b21dc848b1f398-3f00e556-454d4db1-a28fa218-9258601090bb606e233f73e9"><ac:plain-text-body><![CDATA[

[[Sterbenz 2006

AA. Bibliography#Sterbenz 06]]

Antipattern 5, Misusing Public Static Variables

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

...