Versions Compared

Key

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

...

  • If the value of the first operand (operand1) is true, 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

...