Reports casting a value to a concrete class, rather than an interface. Such declarations may represent a failure of abstraction, and may make testing more difficult. Casts to system or library classes and casts inside equals() and clone() methods will not be reported by this inspection.

Example:

interface Entity {}
class EntityImpl implements Entity {}
  
void processObject(Object obj) {
  if (obj instanceof Entity) {
    // warning: cast to the concrete class, rather than the interface
    processEntity((EntityImpl)obj);
  }
}

Use the first checkbox below to ignore casts to abstract classes.

Use the second checkbox below to ignore casts in equals() method implementations.