Reports local variable types that can be inferred from context and replaced with var.

Example:


  void test(InputStream s) {
    try (InputStream in = s) {}
  }

After the fix is applied:


  void test(InputStream s) {
    try (var in = s) {}
  }

Use the Only report when the variable type is obvious from the initializer checkbox to only report the types of variables initialized with a new expression, a type cast or a literal.

Example:


  int    codePointAt = "hello".codePointAt(1); // not reported
  Random random      = new Random();           // reported
  String s           = (String)object;         // reported