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

Member predicate LocalVariableDeclExpr::getInit

Gets the initializer expression of this local variable declaration expression, if any.

Note this applies specifically to a syntactic initialization like T varname = init; to include also e instanceof T varname and switch(e) ... case T varname, which both have the effect of initializing varname to a known local expression without using that syntax, use getInitOrPatternSource.

Expr getInit()