Versions Compared

Key

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

...

Code Block
bgColor#ccccff
public void f(boolean a, boolean b) {
  while ( (a == b) && flag ) {
    /* ... */
  }
}

Exceptions

Using the assignment operator in these conditional expressions is permissible if it is not the controlling expression.

Related Guidelines

ISO/IEC TR 24772:2010

"Likely Incorrect Expression [KOA]"

MITRE CWE

CWE ID 480, "Use of Incorrect Operator"

...