#fixed code
                              private static String streamToString(InputStream inputStream) throws IOException {
    InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
    return CharStreams.toString(reader);
  }
#vulnerable code 
                              private static String streamToString(InputStream inputStream) throws IOException {
    StringBuilder stringBuilder = new StringBuilder();
    Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
    char[] buffer = new char[256];
    int length;

    while ((length = reader.read(buffer)) != -1) {
      stringBuilder.append(buffer, 0, length);
    }
    inputStream.close();
    return stringBuilder.toString();
  } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK