Program: 105092
Project: 105092
Buggy source:
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_TAGS_DELETE,eventDescription="String_Node_Str") public boolean deleteTags(List<String> resourceIds,ResourceObjectType resourceType,Map<String,String> tags){
  Account caller=CallContext.current().getCallingAccount();
  SearchBuilder<ResourceTagVO> sb=_resourceTagDao.createSearchBuilder();
  sb.and().op("String_Node_Str",sb.entity().getResourceId(),SearchCriteria.Op.IN);
  sb.or("String_Node_Str",sb.entity().getResourceUuid(),SearchCriteria.Op.IN);
  sb.cp();
  sb.and("String_Node_Str",sb.entity().getResourceType(),SearchCriteria.Op.EQ);
  SearchCriteria<ResourceTagVO> sc=sb.create();
  sc.setParameters("String_Node_Str",resourceIds.toArray());
  sc.setParameters("String_Node_Str",resourceIds.toArray());
  sc.setParameters("String_Node_Str",resourceType);
  List<? extends ResourceTag> resourceTags=_resourceTagDao.search(sc,null);
  ;
  final List<ResourceTag> tagsToRemove=new ArrayList<ResourceTag>();
  for (  ResourceTag resourceTag : resourceTags) {
    Account owner=_accountMgr.getAccount(resourceTag.getAccountId());
    _accountMgr.checkAccess(caller,null,false,owner);
    if (tags != null && !tags.isEmpty()) {
      for (      String key : tags.keySet()) {
        boolean canBeRemoved=false;
        if (resourceTag.getKey().equalsIgnoreCase(key)) {
          String value=tags.get(key);
          if (value != null) {
            if (resourceTag.getValue().equalsIgnoreCase(value)) {
              canBeRemoved=true;
            }
          }
 else {
            canBeRemoved=true;
          }
          if (canBeRemoved) {
            tagsToRemove.add(resourceTag);
            break;
          }
        }
      }
    }
 else {
      tagsToRemove.add(resourceTag);
    }
  }
  if (tagsToRemove.isEmpty()) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  Transaction.execute(new TransactionCallbackNoReturn(){
    @Override public void doInTransactionWithoutResult(    TransactionStatus status){
      for (      ResourceTag tagToRemove : tagsToRemove) {
        _resourceTagDao.remove(tagToRemove.getId());
        s_logger.debug("String_Node_Str" + tagToRemove);
      }
    }
  }
);
  return true;
}

Fixed version (ground truth):
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_TAGS_DELETE,eventDescription="String_Node_Str") public boolean deleteTags(List<String> resourceIds,ResourceObjectType resourceType,Map<String,String> tags){
  Account caller=CallContext.current().getCallingAccount();
  if (s_logger.isDebugEnabled()) {
    s_logger.debug("String_Node_Str" + String.join("String_Node_Str",resourceIds));
  }
  List<? extends ResourceTag> resourceTags=searchResourceTags(resourceIds,resourceType);
  final List<ResourceTag> tagsToDelete=new ArrayList<>();
  for (  ResourceTag resourceTag : resourceTags) {
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + resourceTag.getResourceId());
      s_logger.debug("String_Node_Str" + resourceTag.getAccountId());
    }
    Account owner=_accountMgr.getAccount(resourceTag.getAccountId());
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + owner);
    }
    _accountMgr.checkAccess(caller,null,false,owner);
    if (MapUtils.isEmpty(tags)) {
      tagsToDelete.add(resourceTag);
    }
 else {
      for (      String key : tags.keySet()) {
        boolean deleteTag=false;
        if (resourceTag.getKey().equalsIgnoreCase(key)) {
          String value=tags.get(key);
          if (value != null) {
            if (resourceTag.getValue().equalsIgnoreCase(value)) {
              deleteTag=true;
            }
          }
 else {
            deleteTag=true;
          }
          if (deleteTag) {
            tagsToDelete.add(resourceTag);
            break;
          }
        }
      }
    }
  }
  if (tagsToDelete.isEmpty()) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  Transaction.execute(new TransactionCallbackNoReturn(){
    @Override public void doInTransactionWithoutResult(    TransactionStatus status){
      for (      ResourceTag tagToRemove : tagsToDelete) {
        _resourceTagDao.remove(tagToRemove.getId());
        s_logger.debug("String_Node_Str" + tagToRemove + "String_Node_Str"+ String.join("String_Node_Str",resourceIds)+ "String_Node_Str");
      }
    }
  }
);
  return true;
}