Reports AutoCloseable instances which are not used in a try-with-resources statement, also known as Automatic Resource Management.

This means that the "open resource before/in try, close in finally" style that had been used before try-with-resources became available, is also reported. This inspection is meant to replace all opened but not safely closed inspections when developing in Java 7 and higher.

Example:


  private static void foo() throws IOException {
    InputStream profile = Thread.currentThread().getContextClassLoader().getResourceAsStream("/someFile");
    System.out.println(profile.read());
  }

Use the following options to configure the inspection: