Reports on uses of instanceof or getClass() == SomeClass.class where the type checked for is a concrete class, rather than an interface. Such uses often indicate excessive coupling to concrete implementations, rather than abstractions. instanceof expressions whose classes come from system or third-party libraries will not be reported by this inspection.

Example:

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

Use the checkbox below to have this inspection ignore instanceof on abstract classes.