Inspectopedia Help

Redundant 'requireNotNull' or 'checkNotNull' call

Reports redundant requireNotNull or checkNotNull call on non-nullable expressions.

Example:

fun foo(i: Int) { requireNotNull(i) // This 'i' is always not null, so this 'requireNotNull' call is redundant. ... }
fun foo(i: Int) { ... }

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Kotlin, 241.14841-IJ

Last modified: 12 March 2024