Program: 135796
Project: 135796
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);
    }
    final Set<String> outLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.OUT_LINKS,outLinks);
    final Set<String> cssLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.CSS_LINKS,cssLinks);
    final Set<String> jsLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.JS_LINKS,jsLinks);
    final Set<String> imgLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.IMG_LINKS,imgLinks);
    int totalPageSize=pageContentSize;
    List<String> pageLinks=new ArrayList<>(cssLinks.size() + jsLinks.size() + imgLinks.size());
    pageLinks.addAll(cssLinks);
    pageLinks.addAll(jsLinks);
    pageLinks.addAll(imgLinks);
    for (    String link : pageLinks) {
      String norm=linkNormalizer.normalize(parseInput.getAttribute(PageAttribute.ORIGINAL_URL).toString(),link);
      Integer assetSize=null;
      if (norm != null) {
        assetSize=getCachedAssetSize(norm);
      }
      if (assetSize == null && norm != null) {
        final Response response=ClientBuilder.newClient().target(norm).request().buildGet().invoke();
        assetSize=response.readEntity(String.class).length();
        setCachedAssetSize(norm,assetSize);
      }
      if (assetSize != null) {
        totalPageSize+=assetSize;
      }
    }
    builder.withAttribute(PageAttribute.SIZE_WITH_ASSETS,totalPageSize);
    String nextQueue=config.getString(NEXT_QUEUE_CONFIG_KEY);
    queueManager.enqueue(nextQueue,objectMapper.writeValueAsString(builder.build()));
    String fetchQueue=config.getString(FETCH_QUEUE_NAME_CONFIG_KEY);
    outLinks.stream().map((link) -> linkNormalizer.normalize(parseInput.getAttribute(PageAttribute.ORIGINAL_URL).toString(),link)).filter(StringUtils::isNotBlank).forEach((link) -> {
      if (alreadySentToFetch(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);
    }
    final Set<String> outLinks=collectLinks(document,"String_Node_Str","String_Node_Str").stream().filter(link -> !StringUtils.startsWith(link,"String_Node_Str")).collect(Collectors.toSet());
    builder.withAttribute(PageAttribute.OUT_LINKS,outLinks);
    final Set<String> cssLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.CSS_LINKS,cssLinks);
    final Set<String> jsLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.JS_LINKS,jsLinks);
    final Set<String> imgLinks=collectLinks(document,"String_Node_Str","String_Node_Str");
    builder.withAttribute(PageAttribute.IMG_LINKS,imgLinks);
    int totalPageSize=pageContentSize;
    List<String> pageLinks=new ArrayList<>(cssLinks.size() + jsLinks.size() + imgLinks.size());
    pageLinks.addAll(cssLinks);
    pageLinks.addAll(jsLinks);
    pageLinks.addAll(imgLinks);
    for (    String link : pageLinks) {
      String norm=linkNormalizer.normalize(parseInput.getAttribute(PageAttribute.ORIGINAL_URL).toString(),link);
      Integer assetSize=null;
      if (norm != null) {
        assetSize=getCachedAssetSize(norm);
      }
      if (assetSize == null && norm != null) {
        final Response response=ClientBuilder.newClient().target(norm).request().buildGet().invoke();
        assetSize=response.readEntity(String.class).length();
        setCachedAssetSize(norm,assetSize);
      }
      if (assetSize != null) {
        totalPageSize+=assetSize;
      }
    }
    builder.withAttribute(PageAttribute.SIZE_WITH_ASSETS,totalPageSize);
    String nextQueue=config.getString(NEXT_QUEUE_CONFIG_KEY);
    queueManager.enqueue(nextQueue,objectMapper.writeValueAsString(builder.build()));
    String fetchQueue=config.getString(FETCH_QUEUE_NAME_CONFIG_KEY);
    outLinks.stream().map((link) -> linkNormalizer.normalize(parseInput.getAttribute(PageAttribute.ORIGINAL_URL).toString(),link)).filter(StringUtils::isNotBlank).forEach((link) -> {
      if (alreadySentToFetch(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;
  }
}