...
Code Block | ||
---|---|---|
| ||
final int authnum = get(); number = ((31 * (number + 1)) * authnum) + (authnum > threshold ? 0 : -2); |
Exceptions
EXP05-J-EX0: The increment and decrement operators (++)
and (--)
read a numeric variable, and then assign a new value to the variable. Although these operators read and modify a value, they are well-understood and are an exception to this rule. This exception does not apply if a value modified by an increment or decrement operator is subsequently read or written.
EXP05-J-EX1: The conditional-or ||
and conditional-and &&
operators have well-understood semantics. Writes followed by subsequent writes or reads do not violate this rule if they occur in different operands of ||
or &&
. Consider the following code example:
...