Inspectopedia Help

Unnecessary explicit numeric cast

Reports primitive numeric casts that would be inserted implicitly by the compiler. Also, reports any primitive numeric casts that the compiler will remove.


int x = (short)5; // The cast will be removed by the javac tool

After the quick-fix is applied:

int x = 5;

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023