google / error-prone

Catch common Java mistakes as compile-time errors

Home Page:https://errorprone.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[PatternMatchingInstanceof] False-positives

boris-petrov opened this issue · comments

public interface MyMap<K, V> {
  default void foo(Object object) {
    if (object instanceof MyMap) {
      var map = (MyMap<K, V>) object;
    }
  }
}

This code gives a PatternMatchingInstanceof warning but that's not true when generics are involved.