Program: 160976
Project: 160976
Buggy source:
private WhoisResources performUpdates(final HttpServletRequest request,final UpdateContext updateContext,final Collection<Update> updates){
  final WhoisResources whoisResources=new WhoisResources();
  whoisResources.setWhoisObjects(Lists.<WhoisObject>newArrayList());
  final List<ErrorMessage> errorMessages=Lists.newArrayList();
  for (  Message message : updateContext.getGlobalMessages().getAllMessages()) {
    errorMessages.add(new ErrorMessage(message));
  }
  for (  Update update : updates) {
    for (    Message message : updateContext.getMessages(update).getMessages().getAllMessages()) {
      errorMessages.add(new ErrorMessage(message));
    }
    for (    Map.Entry<RpslAttribute,Messages> entry : updateContext.getMessages(update).getAttributeMessages().entrySet()) {
      RpslAttribute rpslAttribute=entry.getKey();
      for (      Message message : entry.getValue().getAllMessages()) {
        errorMessages.add(new ErrorMessage(message,rpslAttribute));
      }
    }
  }
  if (!errorMessages.isEmpty()) {
    whoisResources.setErrorMessages(errorMessages);
  }
  for (  Update update : updates) {
    final PreparedUpdate preparedUpdate=updateContext.getPreparedUpdate(update);
    if (preparedUpdate != null) {
      final WhoisObject whoisObject=whoisObjectMapper.map(preparedUpdate.getUpdatedObject(),RestServiceHelper.getServerAttributeMapper(request.getQueryString()));
      whoisResources.getWhoisObjects().add(whoisObject);
    }
  }
  whoisResources.setLink(new Link("String_Node_Str",RestServiceHelper.getRequestURL(request).replaceFirst("String_Node_Str","String_Node_Str")));
  whoisResources.includeTermsAndConditions();
  return whoisResources;
}

Fixed version (ground truth):
private WhoisResources performUpdates(final HttpServletRequest request,final UpdateContext updateContext,final Collection<Update> updates){
  final WhoisResources whoisResources=new WhoisResources();
  final List<ErrorMessage> errorMessages=Lists.newArrayList();
  for (  Message message : updateContext.getGlobalMessages().getAllMessages()) {
    errorMessages.add(new ErrorMessage(message));
  }
  for (  Update update : updates) {
    for (    Message message : updateContext.getMessages(update).getMessages().getAllMessages()) {
      errorMessages.add(new ErrorMessage(message));
    }
    for (    Map.Entry<RpslAttribute,Messages> entry : updateContext.getMessages(update).getAttributeMessages().entrySet()) {
      RpslAttribute rpslAttribute=entry.getKey();
      for (      Message message : entry.getValue().getAllMessages()) {
        errorMessages.add(new ErrorMessage(message,rpslAttribute));
      }
    }
  }
  final List<WhoisObject> whoisObjects=Lists.newArrayList();
  for (  Update update : updates) {
    final PreparedUpdate preparedUpdate=updateContext.getPreparedUpdate(update);
    if (preparedUpdate == null || (preparedUpdate.getAction() == Action.DELETE && updateContext.getStatus(update) != UpdateStatus.SUCCESS)) {
      continue;
    }
    whoisObjects.add(whoisObjectMapper.map(preparedUpdate.getUpdatedObject(),RestServiceHelper.getServerAttributeMapper(request.getQueryString())));
  }
  if (!whoisObjects.isEmpty()) {
    whoisResources.setWhoisObjects(whoisObjects);
  }
  if (!errorMessages.isEmpty()) {
    whoisResources.setErrorMessages(errorMessages);
  }
  whoisResources.setLink(new Link("String_Node_Str",RestServiceHelper.getRequestURL(request).replaceFirst("String_Node_Str","String_Node_Str")));
  whoisResources.includeTermsAndConditions();
  return whoisResources;
}