Reports local variable declarations that can be replaced with pattern variables. E.g.:

  if (obj instanceof String) {
    String str = (String) obj;
    System.out.println(str);
  }
Can be replaced with:

  if (obj instanceof String str) {
    System.out.println(str);
  }

This inspection only reports if the language level of the project or module is 14 (Preview) or higher

New in 2020.1