Program: 51457
Project: 51457
Buggy source:
/** 
 * Populate the Cave repository using the given URL.
 * @param url    the "source" HTTP URL.
 * @param filter regex filter. Only artifacts URL matching the filter will be considered.
 * @param update true if the OBR metadata should be updated, false else.
 * @throws Exception in case of populate failure.
 */
private void populateFromHttp(String url,String filter,boolean update) throws Exception {
  LOGGER.debug("String_Node_Str",url);
  HttpURLConnection conn=(HttpURLConnection)new URL(url).openConnection();
  try (InputStream is=conn.getInputStream()){
    String type=conn.getContentType();
    if ("String_Node_Str".equals(type) || "String_Node_Str".equals(type)) {
      try {
        if ((filter == null) || (url.matches(filter))) {
          ResourceImpl resource=createResource(new URL(url));
          LOGGER.debug("String_Node_Str",url);
          int index=url.lastIndexOf("String_Node_Str");
          if (index > 0) {
            url=url.substring(index + 1);
          }
          Path destination=getLocationPath().resolve(url);
          Files.copy(is,destination);
          if (update) {
            resource=createResource(destination.toUri().toURL());
            LOGGER.debug("String_Node_Str",ResolverUtil.getSymbolicName(resource),ResolverUtil.getVersion(resource));
            addResource(resource);
          }
        }
      }
 catch (      BundleException e) {
        LOGGER.warn(e.getMessage());
      }
    }
 else {
      Document document=Jsoup.parse(is,"String_Node_Str",url);
      for (      Element link : document.select("String_Node_Str")) {
        String absoluteHref=link.attr("String_Node_Str");
        if (absoluteHref.startsWith(url)) {
          populateFromHttp(absoluteHref,filter,update);
        }
      }
    }
  }
 }

Fixed version (ground truth):
/** 
 * Populate the Cave repository using the given URL.
 * @param url    the "source" HTTP URL.
 * @param filter regex filter. Only artifacts URL matching the filter will be considered.
 * @param update true if the OBR metadata should be updated, false else.
 * @throws Exception in case of populate failure.
 */
private void populateFromHttp(String url,String filter,boolean update,List<Resource> resources) throws Exception {
  LOGGER.debug("String_Node_Str",url);
  HttpURLConnection conn=(HttpURLConnection)new URL(url).openConnection();
  try (InputStream is=conn.getInputStream()){
    String type=conn.getContentType();
    if ("String_Node_Str".equals(type) || "String_Node_Str".equals(type)) {
      try {
        if ((filter == null) || (url.matches(filter))) {
          ResourceImpl resource=createResource(new URL(url));
          LOGGER.debug("String_Node_Str",url);
          int index=url.lastIndexOf("String_Node_Str");
          if (index > 0) {
            url=url.substring(index + 1);
          }
          Path destination=getLocationPath().resolve(url);
          Files.copy(is,destination);
          if (update) {
            resource=createResource(destination.toUri().toURL());
            LOGGER.debug("String_Node_Str",ResolverUtil.getSymbolicName(resource),ResolverUtil.getVersion(resource));
            resources.add(resource);
          }
        }
      }
 catch (      BundleException e) {
        LOGGER.warn(e.getMessage());
      }
    }
 else {
      Document document=Jsoup.parse(is,"String_Node_Str",url);
      for (      Element link : document.select("String_Node_Str")) {
        String absoluteHref=link.attr("String_Node_Str");
        if (absoluteHref.startsWith(url)) {
          populateFromHttp(absoluteHref,filter,update,resources);
        }
      }
    }
  }
 }