CodeQL library for Java/Kotlin
codeql/java-all 4.0.1-dev (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.

basicNullGuard

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

basicOrCustomNullGuard

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

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.

guardSuggestsVarMaybeNull

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

Gets a Guard that tests (possibly indirectly) whether a given SSA variable is null or not.

varEqualityTestExpr

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