Inspectopedia Help

Suspicious array cast

Reports suspicious array casts. An array cast is considered suspicious when it casts to a more specific array type. Such a cast is legal at compile time but may fail with a ClassCastException at runtime.

Example:

Number[] numbers = new Number[]{1L, 2L, 4L}; Long[] longs = (Long[])numbers;

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023