#vulnerable code 
                              private String getPageContent(URL url) throws IOException {
    InputStreamReader reader = new InputStreamReader(url.openStream(), "UTF-8");
    StringBuilder builder = new StringBuilder();
    char[] buf = new char[BUF_SIZE];
    int charsRead;
    while ((charsRead = reader.read(buf)) > 0) {
      builder.append(buf, 0, charsRead);
    }
    return builder.toString();
  } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              private String getPageContent(URL url) throws IOException {
    try(InputStreamReader reader = new InputStreamReader(url.openStream(), "UTF-8")) {
      StringBuilder builder = new StringBuilder();
      char[] buf = new char[BUF_SIZE];
      int charsRead;
      while ((charsRead = reader.read(buf)) > 0) {
        builder.append(buf, 0, charsRead);
      }
      return builder.toString();
    }
  }