...
- If the value of the first operand (
operand1
) istrue
, then the second operand expression (operand2
) is chosen - If the value of the first operand is
false
, then the third operand expression (operand3
) is chosen
The rules guidelines (tabulated below) used by a Java compiler to determine the type of the result of a conditional expression are quite complicated and may result in unexpected type conversions. The first matching ruleguideline, starting from the top of the table, is applied. In the table, *
refers to constant expressions of type int
(such as '0' or variables declared final
), Operand 2 refers to operand2
in the general form of a Java conditional given above, and Operand 3 refers to operand3
:
...
Search for vulnerabilities resulting from the violation of this rule guideline on the CERT website.
Bibliography
...