Program: 105091
Project: 105091
Buggy source:
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_TAGS_CREATE,eventDescription="String_Node_Str") public List<ResourceTag> createTags(final List<String> resourceIds,final ResourceObjectType resourceType,final Map<String,String> tags,final String customer){
  final Account caller=CallContext.current().getCallingAccount();
  final List<ResourceTag> resourceTags=new ArrayList<ResourceTag>(tags.size());
  Transaction.execute(new TransactionCallbackNoReturn(){
    @Override public void doInTransactionWithoutResult(    TransactionStatus status){
      for (      String key : tags.keySet()) {
        for (        String resourceId : resourceIds) {
          if (!resourceType.resourceTagsSupport()) {
            throw new InvalidParameterValueException("String_Node_Str" + resourceType + "String_Node_Str");
          }
          long id=getResourceId(resourceId,resourceType);
          String resourceUuid=getUuid(resourceId,resourceType);
          Pair<Long,Long> accountDomainPair=getAccountDomain(id,resourceType);
          Long domainId=accountDomainPair.second();
          Long accountId=accountDomainPair.first();
          if ((domainId != null) && (domainId == -1)) {
            throw new CloudRuntimeException("String_Node_Str");
          }
          if (accountId != null) {
            _accountMgr.checkAccess(caller,null,false,_accountMgr.getAccount(accountId));
          }
 else           if (domainId != null && !_accountMgr.isNormalUser(caller.getId())) {
            _accountMgr.checkAccess(caller,_domainMgr.getDomain(domainId));
          }
 else {
            throw new PermissionDeniedException("String_Node_Str" + caller + "String_Node_Str"+ "String_Node_Str"+ key);
          }
          String value=tags.get(key);
          if (value == null || value.isEmpty()) {
            throw new InvalidParameterValueException("String_Node_Str" + key + "String_Node_Str");
          }
          ResourceTagVO resourceTag=new ResourceTagVO(key,value,accountDomainPair.first(),accountDomainPair.second(),id,resourceType,customer,resourceUuid);
          resourceTag=_resourceTagDao.persist(resourceTag);
          resourceTags.add(resourceTag);
        }
      }
    }
  }
);
  return resourceTags;
}

Fixed version (ground truth):
@Override @DB @ActionEvent(eventType=EventTypes.EVENT_TAGS_CREATE,eventDescription="String_Node_Str") public List<ResourceTag> createTags(final List<String> resourceIds,final ResourceObjectType resourceType,final Map<String,String> tags,final String customer){
  final Account caller=CallContext.current().getCallingAccount();
  final List<ResourceTag> resourceTags=new ArrayList<>(tags.size());
  Transaction.execute(new TransactionCallbackNoReturn(){
    @Override public void doInTransactionWithoutResult(    TransactionStatus status){
      for (      String key : tags.keySet()) {
        for (        String resourceId : resourceIds) {
          if (!resourceType.resourceTagsSupport()) {
            throw new InvalidParameterValueException("String_Node_Str" + resourceType + "String_Node_Str");
          }
          long id=getResourceId(resourceId,resourceType);
          String resourceUuid=getUuid(resourceId,resourceType);
          Pair<Long,Long> accountDomainPair=getAccountDomain(id,resourceType);
          Long domainId=accountDomainPair.second();
          Long accountId=accountDomainPair.first();
          checkResourceAccessible(accountId,domainId,"String_Node_Str" + caller + "String_Node_Str"+ "String_Node_Str"+ id+ "String_Node_Str"+ key+ "String_Node_Str");
          String value=tags.get(key);
          if (value == null || value.isEmpty()) {
            throw new InvalidParameterValueException("String_Node_Str" + key + "String_Node_Str");
          }
          ResourceTagVO resourceTag=new ResourceTagVO(key,value,accountDomainPair.first(),accountDomainPair.second(),id,resourceType,customer,resourceUuid);
          resourceTag=_resourceTagDao.persist(resourceTag);
          resourceTags.add(resourceTag);
        }
      }
    }
  }
);
  return resourceTags;
}