Program: 135795
Project: 135795
Buggy source:
@Override public boolean doWork(){
  try {
    String bucketName=config.getString(BUCKET_NAME_CONFIG_KEY);
    String pageContentRef=parseInput.getAttribute(PageAttribute.PAGE_CONTENT_REF).toString();
    GetObjectRequest getObjectRequest=new GetObjectRequest(bucketName,pageContentRef);
    final S3Object s3Object=retry(() -> amazonS3Client.getObject(getObjectRequest));
    final String pageContent=IOUtils.toString(s3Object.getObjectContent());
    IOUtils.closeQuietly(s3Object.getObjectContent());
    Document document=Jsoup.parse(pageContent);
    IndexInput.Builder builder=new IndexInput.Builder().withExistingAttributes(parseInput.getAttributes());
    int pageContentSize=pageContent.length();
    builder.withAttribute(PageAttribute.CONTENT_SIZE,pageContentSize);
    String title=document.title();
    if (title != null) {
      builder.withAttribute(PageAttribute.TITLE,title);
    }
    Set<String> outLinks=document.getElementsByTag("String_Node_Str").stream().filter(elem -> !StringUtils.equalsIgnoreCase("String_Node_Str",elem.attr("String_Node_Str"))).map(elem -> elem.attr("String_Node_Str")).filter(StringUtils::isNotBlank).filter(link -> !StringUtils.startsWith(link,"String_Node_Str")).filter(link -> !StringUtils.startsWith(link,"String_Node_Str")).collect(Collectors.toSet());
    builder.withAttribute(PageAttribute.OUT_LINKS_RAW,outLinks);
    outLinks=normalizeLinks(outLinks);
    builder.withAttribute(PageAttribute.OUT_LINKS,outLinks);
    Set<String> cssLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.CSS_LINKS_RAW,cssLinks);
    cssLinks=normalizeLinks(cssLinks);
    builder.withAttribute(PageAttribute.CSS_LINKS,cssLinks);
    Set<String> jsLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.JS_LINKS_RAW,jsLinks);
    jsLinks=normalizeLinks(jsLinks);
    builder.withAttribute(PageAttribute.JS_LINKS,jsLinks);
    Set<String> imgLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.IMG_LINKS_RAW,imgLinks);
    imgLinks=normalizeLinks(imgLinks);
    builder.withAttribute(PageAttribute.IMG_LINKS,imgLinks);
    int totalPageSize=pageContentSize;
    List<String> assetLinks=new ArrayList<>(cssLinks.size() + jsLinks.size() + imgLinks.size());
    assetLinks.addAll(cssLinks);
    assetLinks.addAll(jsLinks);
    assetLinks.addAll(imgLinks);
    for (    String link : assetLinks) {
      Integer assetSize=getCachedAssetSize(link);
      if (assetSize == null && link != null) {
        final Response response=ClientBuilder.newClient().target(link).request().buildGet().invoke();
        assetSize=response.readEntity(String.class).length();
        setCachedAssetSize(link,assetSize);
      }
      if (assetSize != null) {
        totalPageSize+=assetSize;
      }
    }
    builder.withAttribute(PageAttribute.SIZE_WITH_ASSETS,totalPageSize);
    final Map<String,List<String>> linksByContentType=outLinks.stream().filter(StringUtils::isNotBlank).collect(Collectors.groupingBy(link -> {
      try {
        final Response response=ClientBuilder.newClient().target(link).request().build("String_Node_Str").invoke();
        final String contentType=response.getStringHeaders().getFirst(CONTENT_TYPE_HEADER_KEY);
        if (StringUtils.isNotBlank(contentType)) {
          return contentType;
        }
 else {
          return NO_CONTENT_TYPE_KEY;
        }
      }
 catch (      Exception ex) {
        logger.error("String_Node_Str" + link,ex);
        return EXCEPTION_KEY;
      }
    }
));
    String nextQueue=config.getString(NEXT_QUEUE_CONFIG_KEY);
    queueManager.enqueue(nextQueue,objectMapper.writeValueAsString(builder.build()));
    String fetchQueue=config.getString(FETCH_QUEUE_NAME_CONFIG_KEY);
    linksByContentType.entrySet().forEach(entry -> {
      if (StringUtils.startsWithIgnoreCase(entry.getKey(),IMAGE_CONTENT_TYPE_PREFIX) || StringUtils.equals(entry.getKey(),EXCEPTION_KEY)) {
        return;
      }
      entry.getValue().forEach(link -> {
        if (alreadySentToFetch(link) || (config.getBoolean(USE_BASE_DOMAIN_CONFIG_KEY) && DomainUtils.isBaseDomain(config.getString(BASE_DOMAIN_CONFIG_KEY),link))) {
          return;
        }
        try {
          logger.info("String_Node_Str" + link);
          FetchInput fetchInput=new FetchInput(link,parseInput.getAttribute(PageAttribute.ORIGINAL_URL).toString());
          queueManager.enqueue(fetchQueue,objectMapper.writeValueAsString(fetchInput));
          sentToFetch(link);
        }
 catch (        Exception ex) {
          throw new RuntimeException(ex.getMessage(),ex);
        }
      }
);
    }
);
    return true;
  }
 catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean doWork(){
  try {
    String bucketName=config.getString(BUCKET_NAME_CONFIG_KEY);
    String pageContentRef=parseInput.getAttribute(PageAttribute.PAGE_CONTENT_REF).toString();
    GetObjectRequest getObjectRequest=new GetObjectRequest(bucketName,pageContentRef);
    final S3Object s3Object=retry(() -> amazonS3Client.getObject(getObjectRequest));
    final String pageContent=IOUtils.toString(s3Object.getObjectContent());
    IOUtils.closeQuietly(s3Object.getObjectContent());
    Document document=Jsoup.parse(pageContent);
    IndexInput.Builder builder=new IndexInput.Builder().withExistingAttributes(parseInput.getAttributes());
    int pageContentSize=pageContent.length();
    builder.withAttribute(PageAttribute.CONTENT_SIZE,pageContentSize);
    String title=document.title();
    if (title != null) {
      builder.withAttribute(PageAttribute.TITLE,title);
    }
    Set<String> outLinks=document.getElementsByTag("String_Node_Str").stream().filter(elem -> !StringUtils.equalsIgnoreCase("String_Node_Str",elem.attr("String_Node_Str"))).map(elem -> elem.attr("String_Node_Str")).filter(StringUtils::isNotBlank).filter(link -> !StringUtils.startsWith(link,"String_Node_Str")).filter(link -> !StringUtils.startsWith(link,"String_Node_Str")).collect(Collectors.toSet());
    builder.withAttribute(PageAttribute.OUT_LINKS_RAW,outLinks);
    outLinks=normalizeLinks(outLinks);
    builder.withAttribute(PageAttribute.OUT_LINKS,outLinks);
    Set<String> cssLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.CSS_LINKS_RAW,cssLinks);
    cssLinks=normalizeLinks(cssLinks);
    builder.withAttribute(PageAttribute.CSS_LINKS,cssLinks);
    Set<String> jsLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.JS_LINKS_RAW,jsLinks);
    jsLinks=normalizeLinks(jsLinks);
    builder.withAttribute(PageAttribute.JS_LINKS,jsLinks);
    Set<String> imgLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.IMG_LINKS_RAW,imgLinks);
    imgLinks=normalizeLinks(imgLinks);
    builder.withAttribute(PageAttribute.IMG_LINKS,imgLinks);
    int totalPageSize=pageContentSize;
    List<String> assetLinks=new ArrayList<>(cssLinks.size() + jsLinks.size() + imgLinks.size());
    assetLinks.addAll(cssLinks);
    assetLinks.addAll(jsLinks);
    assetLinks.addAll(imgLinks);
    for (    String link : assetLinks) {
      Integer assetSize=getCachedAssetSize(link);
      if (assetSize == null && link != null) {
        final Response response=ClientBuilder.newClient().target(link).request().buildGet().invoke();
        assetSize=response.readEntity(String.class).length();
        setCachedAssetSize(link,assetSize);
      }
      if (assetSize != null) {
        totalPageSize+=assetSize;
      }
    }
    builder.withAttribute(PageAttribute.SIZE_WITH_ASSETS,totalPageSize);
    final Map<String,List<String>> linksByContentType=outLinks.stream().filter(StringUtils::isNotBlank).collect(Collectors.groupingBy(link -> {
      try {
        final Response response=ClientBuilder.newClient().target(link).request().build("String_Node_Str").invoke();
        final String contentType=response.getStringHeaders().getFirst(CONTENT_TYPE_HEADER_KEY);
        if (StringUtils.isNotBlank(contentType)) {
          return contentType;
        }
 else {
          return NO_CONTENT_TYPE_KEY;
        }
      }
 catch (      Exception ex) {
        logger.error("String_Node_Str" + link,ex);
        return EXCEPTION_KEY;
      }
    }
));
    String nextQueue=config.getString(NEXT_QUEUE_CONFIG_KEY);
    queueManager.enqueue(nextQueue,objectMapper.writeValueAsString(builder.build()));
    String fetchQueue=config.getString(FETCH_QUEUE_NAME_CONFIG_KEY);
    linksByContentType.entrySet().forEach(entry -> {
      if (StringUtils.startsWithIgnoreCase(entry.getKey(),IMAGE_CONTENT_TYPE_PREFIX) || StringUtils.equals(entry.getKey(),EXCEPTION_KEY)) {
        return;
      }
      entry.getValue().forEach(link -> {
        if (alreadySentToFetch(link) || (config.getBoolean(USE_BASE_DOMAIN_CONFIG_KEY) && !DomainUtils.isBaseDomain(config.getString(BASE_DOMAIN_CONFIG_KEY),link))) {
          return;
        }
        try {
          logger.info("String_Node_Str" + link);
          FetchInput fetchInput=new FetchInput(link,parseInput.getAttribute(PageAttribute.ORIGINAL_URL).toString());
          queueManager.enqueue(fetchQueue,objectMapper.writeValueAsString(fetchInput));
          sentToFetch(link);
        }
 catch (        Exception ex) {
          throw new RuntimeException(ex.getMessage(),ex);
        }
      }
);
    }
);
    return true;
  }
 catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    return false;
  }
}