#fixed code
                              private void assertFileContains(File file, Matcher matcher)
      throws IOException {
    final BufferedReader br = new BufferedReader(
        new InputStreamReader(
            new FileInputStream(file), StandardCharsets.UTF_8.name()));
    final StringWriter stringWriter = new StringWriter();
    for (;;) {
      final String line = br.readLine();
      if (line == null) {
        break;
      }
      stringWriter.write(line);
      stringWriter.write("\n");
    }
    br.close();
    assertThat(toLinux(stringWriter.toString()), matcher);
  }
#vulnerable code 
                              private void assertFileContains(File file, Matcher matcher)
      throws IOException {
    final BufferedReader br = new BufferedReader(new FileReader(file));
    final StringWriter stringWriter = new StringWriter();
    for (;;) {
      final String line = br.readLine();
      if (line == null) {
        break;
      }
      stringWriter.write(line);
      stringWriter.write("\n");
    }
    br.close();
    assertThat(toLinux(stringWriter.toString()), matcher);
  } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK