Inspectopedia
 
2024.3

Unnecessary explicit numeric cast

Warning
New
Last modified: 03 December 2024

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

Example:

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

After the quick-fix is applied:

int x = 5;