Query module DangerousNonCircuitLogic

name
Dangerous non-short-circuit logic
description
Using a bitwise logical operator on a boolean where a conditional-and or conditional-or operator is intended may yield the wrong result or cause an exception.
kind
problem
problem.severity
warning
precision
medium
id
java/non-short-circuit-evaluation
tags
reliability readability external/cwe/cwe-691

Imports

java

Provides all default Java QL imports.

Classes

DangerousExpression

An expression containing a method access, array access, or qualified field access.

NonShortCircuit

A use of & or | on operands of type boolean.