Reports type cast expressions where the cast type is an interface and the cast expression has a class type that neither implements the cast interface, nor has any visible subclasses that implement the cast interface.

Although this might be intended, such a construct is most likely an error, and will result in a java.lang.ClassCastException at runtime.

Example:


  interface A {}
  interface Z {}
  static class C {}

  void x(C c) {
    if (c instanceof Z) {
      A a = ((A)c); // cast to incompatible interface 'A'
    }
  }