CodeQL library for Java/Kotlin
codeql/java-all 8.1.1 (changelog, source)
Search

Module NullGuards

Provides classes and predicates for null guards.

Import path

import semmle.code.java.dataflow.NullGuards

Imports

SSA

Provides classes and predicates for SSA representation (Static Single Assignment form).

java

Provides all default Java QL imports.

Predicates

alwaysNullExpr

Gets an expression that is always null.

baseNotNullExpr

Gets an expression that is provably not null.

basicNullGuard

Gets an expression that directly tests whether a given expression, e, is null or not.

basicOrCustomNullGuard

DEPRECATED: Use basicNullGuard instead.

clearlyNotNull

Holds if v is an SSA variable that is provably not null.

clearlyNotNull

Holds if v is an SSA variable that is provably not null.

clearlyNotNullExpr

Gets an expression that is provably not null.

clearlyNotNullExpr

Gets an expression that is provably not null.

directNullGuard

Gets an expression that directly tests whether a given SSA variable is null or not.

enumConstEquality

Gets an equality test between an expression e and an enum constant c.

guardSuggestsExprMaybeNull

Holds if guard is a guard expression that suggests that e might be null.

guardSuggestsVarMaybeNull

Holds if guard is a guard expression that suggests that v might be null.

instanceofExpr

Gets an instanceof expression of v with type type

nullCheckMethod

Holds if the evaluation of a call to m resulting in the value branch implies that the argument to the call is guaranteed to be null if isnull is true, and non-null if isnull is false.

nullGuard

DEPRECATED: Use nullGuardControls/nullGuardControlsBranchEdge instead.

nullGuardControls

Holds if there exists a null check on v that controls bb, such that in bb v is guaranteed to be null if isnull is true, and non-null if isnull is false.

nullGuardControlsBranchEdge

Holds if there exists a null check on v, such that taking the branch edge from bb1 to bb2 implies that v is guaranteed to be null if isnull is true, and non-null if isnull is false.

varEqualityTestExpr

Gets an expression of the form v1 == v2 or v1 != v2. The predicate is symmetric in v1 and v2.