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

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

import 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.