Inspectopedia 2026.3 Help

The kotlin-reflect library is required for fastjson2-kotlin

Reports usages of fastjson2 or fastjson2-kotlin in Kotlin code when kotlin-reflect is missing from the containing module's classpath.

According to the Fastjson2 documentation, kotlin-reflect is recommended when using Kotlin data classes or constructor-based parameter passing.

Without kotlin-reflect, constructor parameter names may not be resolved in some environments, which may cause deserialization of Kotlin classes to fail or produce incorrect results.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

Fastjson2MissingKotlinReflect
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | Kotlin | Probable bugs

Example:

// FILE: Main.kt import com.alibaba.fastjson2.JSON data class User( val name: String, val age: Int, ) fun main() { val json = """{"name":"Alice","age":30}""" // Without kotlin-reflect, deserialization of Kotlin classes // may fail or produce incorrect results in some environments. val user = JSON.parseObject(json, User::class.java) println(user) }

The quick-fix adds a kotlin-reflect dependency to the affected module.

Quick-fix result in build.gradle.kts:

// FILE: build.gradle.kts dependencies { implementation("com.alibaba.fastjson2:fastjson2:2.0.63") // or implementation("com.alibaba.fastjson2:fastjson2-kotlin:2.0.63") implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version") // added by quick-fix }

Quick-fix result in pom.xml:

// FILE: pom.xml <dependencies> <dependency> <groupId>com.alibaba.fastjson2</groupId> <artifactId>fastjson2</artifactId> <version>2.0.63</version> </dependency> <!-- or fastjson2-kotlin --> <!-- added by quick-fix --> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-reflect</artifactId> <version>${kotlin.version}</version> </dependency> </dependencies>

Inspection ID: Fastjson2MissingKotlinReflect

Suppressing Inspection

You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:

//noinspection Fastjson2MissingKotlinReflect

More detailed instructions as well as other ways and options that you have can be found in the product documentation:

Inspection Details

By default bundled with:

IntelliJ IDEA 2026.3, Qodana for JVM 2026.3,

Last modified: 20 November 2026