Versions Compared

Key

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

...

Alternatively, the addition could be performed using type long and the result of the addition stored in a local variable of type long. This alternate implementation would require a check to ensure that the resulting long can be represented in the range of the type int. Failure of this latter check would indicate that an int version of the addition would have overflowed.

Risk Assessment

Failure Using assertions to validate method arguments can result in inconsistent computations, runtime exceptions, and control flow vulnerabilities.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8239b6a804e6fcb1-1011279e-469d400a-8267b5b2-b61bbbb76897d749711e859d"><ac:plain-text-body><![CDATA[

[[Daconta 2003

AA. Bibliography#Daconta 03]]

Item 7. My assertions are not gratuitous

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d76b53436864fd9f-d8b9c924-4f0544f7-b7e4b2e6-03a3c85ea2fac916e56be74d"><ac:plain-text-body><![CDATA[

[[ESA 2005

AA. Bibliography#ESA 05]]

Rule 68. Explicitly check method parameters for validity, and throw an adequate exception in case they are not valid. Do not use the assert statement for this purpose

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c9f2f637158e00be-f6b877b2-4f8b4354-a07ba3d7-fc50470db2f293d009bad71d"><ac:plain-text-body><![CDATA[

[[JLS 2005

AA. Bibliography#JLS 05]]

§14.10, The assert Statement

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

...