Program: 89535
Project: 89535
Buggy source:
private void writeFtpRecords(WARCWriter w,final CrawlURI curi,final URI baseid,final String timestamp) throws IOException {
  ANVLRecord headers=new ANVLRecord(3);
  headers.addLabelValue(HEADER_KEY_IP,getHostAddress(curi));
  String controlConversation=curi.getString(A_FTP_CONTROL_CONVERSATION);
  URI rid=writeFtpControlConversation(w,timestamp,baseid,curi,headers,controlConversation);
  if (curi.getContentDigest() != null) {
    headers.addLabelValue(HEADER_KEY_PAYLOAD_DIGEST,curi.getContentDigestSchemeString());
  }
  if (curi.getHttpRecorder() != null) {
    if (IdenticalDigestDecideRule.hasIdenticalDigest(curi) && ((Boolean)getUncheckedAttribute(curi,ATTR_WRITE_REVISIT_FOR_IDENTICAL_DIGESTS))) {
      rid=writeRevisitDigest(w,timestamp,null,baseid,curi,headers);
    }
 else {
      headers=new ANVLRecord(3);
      if (curi.isTruncatedFetch()) {
        String value=curi.isTimeTruncatedFetch() ? NAMED_FIELD_TRUNCATED_VALUE_TIME : curi.isLengthTruncatedFetch() ? NAMED_FIELD_TRUNCATED_VALUE_LENGTH : curi.isHeaderTruncatedFetch() ? NAMED_FIELD_TRUNCATED_VALUE_HEAD : TRUNCATED_VALUE_UNSPECIFIED;
        headers.addLabelValue(HEADER_KEY_TRUNCATED,value);
      }
      if (curi.getContentDigest() != null) {
        headers.addLabelValue(HEADER_KEY_PAYLOAD_DIGEST,curi.getContentDigestSchemeString());
      }
      headers.addLabelValue(HEADER_KEY_CONCURRENT_TO,'<' + rid.toString() + '>');
      rid=writeResource(w,timestamp,curi.getContentType(),baseid,curi,headers);
    }
  }
  if (((Boolean)getUncheckedAttribute(curi,ATTR_WRITE_METADATA))) {
    headers=new ANVLRecord(1);
    headers.addLabelValue(HEADER_KEY_CONCURRENT_TO,'<' + rid.toString() + '>');
    writeMetadata(w,timestamp,baseid,curi,headers);
  }
}

Fixed version (ground truth):
private void writeFtpRecords(WARCWriter w,final CrawlURI curi,final URI baseid,final String timestamp) throws IOException {
  ANVLRecord headers=new ANVLRecord(3);
  headers.addLabelValue(HEADER_KEY_IP,getHostAddress(curi));
  String controlConversation=curi.getString(A_FTP_CONTROL_CONVERSATION);
  URI rid=writeFtpControlConversation(w,timestamp,baseid,curi,headers,controlConversation);
  if (curi.getContentDigest() != null) {
    headers.addLabelValue(HEADER_KEY_PAYLOAD_DIGEST,curi.getContentDigestSchemeString());
  }
  if (curi.getHttpRecorder() != null) {
    if (IdenticalDigestDecideRule.hasIdenticalDigest(curi) && ((Boolean)getUncheckedAttribute(curi,ATTR_WRITE_REVISIT_FOR_IDENTICAL_DIGESTS))) {
      rid=writeRevisitDigest(w,timestamp,null,baseid,curi,headers);
    }
 else {
      headers=new ANVLRecord(3);
      if (curi.isTruncatedFetch()) {
        String value=curi.isTimeTruncatedFetch() ? NAMED_FIELD_TRUNCATED_VALUE_TIME : curi.isLengthTruncatedFetch() ? NAMED_FIELD_TRUNCATED_VALUE_LENGTH : curi.isHeaderTruncatedFetch() ? NAMED_FIELD_TRUNCATED_VALUE_HEAD : TRUNCATED_VALUE_UNSPECIFIED;
        headers.addLabelValue(HEADER_KEY_TRUNCATED,value);
      }
      if (curi.getContentDigest() != null) {
        headers.addLabelValue(HEADER_KEY_PAYLOAD_DIGEST,curi.getContentDigestSchemeString());
      }
      headers.addLabelValue(HEADER_KEY_CONCURRENT_TO,'<' + rid.toString() + '>');
      rid=writeResource(w,timestamp,curi.getContentType(),baseid,curi,headers);
    }
  }
  if (((Boolean)getUncheckedAttribute(curi,ATTR_WRITE_METADATA))) {
    headers=new ANVLRecord(1);
    headers.addLabelValue(HEADER_KEY_CONCURRENT_TO,'<' + rid.toString() + '>');
    writeMetadata(w,timestamp,baseid,curi,headers,((Boolean)getUncheckedAttribute(curi,ATTR_WRITE_METADATA_OUTLINKS)));
  }
}