Inspectopedia Help

Constant expression can be evaluated

Reports compile-time constant expressions and suggests replacing them with their actual values. For example, you will be prompted to replace "2 + 2" with "4".

Use the Don't report when the expression contains references to defined constants option to ignore the expressions which contain references to non-literal operands, such as fields, and variables.

New in 2018.1

Inspection options

Option

Type

Default

Don't report when the expression contains references to defined constants

Checkbox

false

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023