Program: 89993
Project: 89993
Buggy source:
/** 
 * Generate a MetadataEntry from a list of AliasInfo objects (VERSION 2) Expired aliases is skipped by this method.
 * @param aliases the list of aliases (possibly empty)
 * @param origHarvestDefinitionID
 * @param harvestNum
 * @param jobId
 * @return null, if the list if empty (or only consists of expired aliases),otherwise returns a MetadataEntry from a list of AliasInfo objects containing unexpired aliases.
 */
public static MetadataEntry makeAliasMetadataEntry(List<AliasInfo> aliases,Long origHarvestDefinitionID,int harvestNum,Long jobId){
  ArgumentNotValid.checkNotNull(aliases,"String_Node_Str");
  ArgumentNotValid.checkNotNull(origHarvestDefinitionID,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(harvestNum,"String_Node_Str");
  ArgumentNotValid.checkNotNull(jobId,"String_Node_Str");
  if (aliases.isEmpty()) {
    return null;
  }
  List<AliasInfo> nonExpiredAliases=new ArrayList<AliasInfo>();
  for (  AliasInfo alias : aliases) {
    if (!alias.isExpired()) {
      nonExpiredAliases.add(alias);
    }
  }
  if (nonExpiredAliases.isEmpty()) {
    return null;
  }
  String metadataUrl=String.format(ALIAS_METADATA_URL,origHarvestDefinitionID,harvestNum,jobId);
  StringBuffer sb=new StringBuffer();
  for (  AliasInfo alias : nonExpiredAliases) {
    sb.append(alias.getDomain()).append("String_Node_Str").append(alias.getAliasOf()).append("String_Node_Str");
  }
  return new MetadataEntry(metadataUrl,MIMETYPE_TEXT_PLAIN,sb.toString());
}

Fixed version (ground truth):
/** 
 * Generate a MetadataEntry from a list of AliasInfo objects (VERSION 2) Expired aliases is skipped by this method.
 * @param aliases the list of aliases (possibly empty)
 * @param origHarvestDefinitionID The harvestdefinition that is behind the job with the given jobId
 * @param harvestNum The number of the harvest that the job with the givenjobid belongs to
 * @param jobId The id of the Job, which this metadata belongs to
 * @return null, if the list if empty (or only consists of expired aliases),otherwise returns a MetadataEntry from a list of AliasInfo objects containing unexpired aliases.
 */
public static MetadataEntry makeAliasMetadataEntry(List<AliasInfo> aliases,Long origHarvestDefinitionID,int harvestNum,Long jobId){
  ArgumentNotValid.checkNotNull(aliases,"String_Node_Str");
  ArgumentNotValid.checkNotNull(origHarvestDefinitionID,"String_Node_Str");
  ArgumentNotValid.checkNotNegative(harvestNum,"String_Node_Str");
  ArgumentNotValid.checkNotNull(jobId,"String_Node_Str");
  if (aliases.isEmpty()) {
    return null;
  }
  List<AliasInfo> nonExpiredAliases=new ArrayList<AliasInfo>();
  for (  AliasInfo alias : aliases) {
    if (!alias.isExpired()) {
      nonExpiredAliases.add(alias);
    }
  }
  if (nonExpiredAliases.isEmpty()) {
    return null;
  }
  String metadataUrl=String.format(ALIAS_METADATA_URL,origHarvestDefinitionID,harvestNum,jobId);
  StringBuffer sb=new StringBuffer();
  for (  AliasInfo alias : nonExpiredAliases) {
    sb.append(alias.getDomain()).append("String_Node_Str").append(alias.getAliasOf()).append("String_Node_Str");
  }
  return new MetadataEntry(metadataUrl,MIMETYPE_TEXT_PLAIN,sb.toString());
}