Module Nullness

Provides classes and predicates for nullness analysis.

Local variables that may be null are tracked to see if they might reach a dereference and cause a NullPointerException. Assertions are assumed to hold, so results guarded by, for example, assert x != null; or if (x == null) { assert false; } are excluded.

Import path

semmle.code.java.dataflow.Nullness

Imports

java

Provides all default Java QL imports.

Predicates

alwaysNullDeref

A dereference of a variable that is always null.

dereference

An expression that is being dereferenced. These are the points where NullPointerExceptions can occur.

nullDeref

A potential null dereference that has not been proven safe.

nullExpr

Gets an expression that may be null.

Datatypes

TrackVarKind
TrackedValue

The abstract value of the tracked variable.