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

Member predicate PrimitiveType::getADefaultValue

Gets a default value for this primitive type, as assigned by the compiler for variables that are declared but not initialized explicitly. Typically zero for numeric and character types and false for boolean.

For numeric primitive types, default literals of one numeric type are also considered to be default values of all other numeric types, even if they require an explicit cast.

Literal getADefaultValue()