Versions Compared

Key

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

...

Although final can be used to specify immutable constants, there is a caveat when dealing with composite objects. See guideline "OBJ02-J. Never conflate immutability of a reference with that of the referenced object" for more details.

Noncompliant Code Example

...

The methods use the seemingly-random literals 12.56, 4.19, and 6.28 to represent various scaling factors used to calculate these dimensions. A developer or maintainer reading this code would have little idea about how they were generated or what they mean and, and consequently, would be unable to understand the function of this code.

...

C Secure Coding Standard: "DCL06-C. Use meaningful symbolic constants to represent literal values"

Bibliography

<ac:structured-macro ac:name="unmigrated-wiki-markup

...

" ac:schema-version="1" ac:macro-id="259a2d05-fec7-4f78-a0c0-ebb59ab8c1c3"><ac:plain-text-body><![CDATA[

[[API

...

2006

...

AA.

...

Bibliography#API

...

06]]

]

...

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a6ba0a3a-8e05-444f-a3f1-f60ba352838f"><ac:plain-text-body><![CDATA[

[[Core Java 2004

AA. Bibliography#Core Java 04]]

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

...

DCL01-J. Do not declare more than one variable per declaration      01. Declarations and Initialization (DCL)      DCL03-J. Properly encode relationships in constant definitions