#vulnerable code 
                              private String getUrlContents(String urlString) throws Exception {
    System.setProperty ("jsse.enableSNIExtension", "false");
    URL url = new URL(urlString);
    BufferedReader in = new BufferedReader(
      new InputStreamReader(url.openStream()));

    String inputLine;
    StringBuilder contents = new StringBuilder();
    while ((inputLine = in.readLine()) != null)
      contents.append(inputLine);
    in.close();
    return contents.toString();
  } 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              private String getUrlContents(String urlString) throws Exception {
    System.setProperty ("jsse.enableSNIExtension", "false");

    URL url = new URL(urlString);

    URLConnection urlc = url.openConnection();
    urlc.setRequestProperty("Accept", "application/json, */*");
    urlc.connect();

    StringBuilder contents = new StringBuilder();
    InputStream in = urlc.getInputStream();
    for(int i = 0;i!= -1;i= in.read()){
      char c = (char)i;
      if(!Character.isISOControl(c))
        contents.append((char)i);
    }
    in.close();

    return contents.toString();
  }