Inspectopedia Help

Redundant type cast

Reports unnecessary cast expressions.

Example:

static Object toObject(String s) { return (Object) s; }

Use the checkbox below to ignore clarifying casts e.g., casts in collection calls where Object is expected:

static void removeFromList(List<String> l, Object o) { l.remove((String)o); }

Inspection options

Option

Type

Default

Ignore clarifying casts

Checkbox

true

Inspection Details

Available in:

AppCode 2023.3, IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023