Overly strong type cast
Reports type casts that are overly strong. For instance, casting an object to
ArrayList when casting it to
List would do just as well.
Note: much like the Redundant type cast inspection, applying the fix for this inspection may change the semantics of your program if you are intentionally using an overly strong cast to cause a
ClassCastException to be generated.
Use the checkbox below to ignore casts when there's a matching
instanceof check in the code.
Ignore casts with a matching instanceof expression
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3