Versions Compared

Key

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

...

When the assignment of b to a is unintended, this conditional block is now executed only when a is equal to b.

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

Use one of the above solutions when the assignment is intended.

...

Related Guidelines

ISO/IEC TR 24772:2010

"Likely Incorrect Expression [KOA]"

MITRE CWE

CWE ID 480, "Use of Incorrect Operator"

...