Program: 14351
Project: 14351
Buggy source:
public CreateTagsResponseType createTags(final CreateTagsType request) throws EucalyptusCloudException {
  final CreateTagsResponseType reply=request.getReply();
  reply.set_return(false);
  final Context context=Contexts.lookup();
  final OwnerFullName ownerFullName=context.getUserFullName();
  final List<String> resourceIds=Objects.firstNonNull(request.getResourcesSet(),Collections.<String>emptyList());
  final List<ResourceTag> resourceTags=Objects.firstNonNull(request.getTagSet(),Collections.<ResourceTag>emptyList());
  for (  final ResourceTag resourceTag : resourceTags) {
    final String key=resourceTag.getKey();
    final String value=Strings.nullToEmpty(resourceTag.getValue()).trim();
    if (Strings.isNullOrEmpty(key) || key.trim().length() > 128 || isReserved(key)) {
      throw new InvalidParameterValueException("String_Node_Str" + reservedPrefixes + "String_Node_Str"+ key);
    }
    if (value.length() > 256 || isReserved(key)) {
      throw new InvalidParameterValueException("String_Node_Str" + reservedPrefixes + "String_Node_Str"+ value);
    }
  }
  if (resourceTags.size() > 0 && resourceIds.size() > 0) {
    final Predicate<Void> creator=new Predicate<Void>(){
      @Override public boolean apply(      final Void v){
        final List<CloudMetadata> resources=Lists.transform(resourceIds,resourceLookup());
        if (!Iterables.all(resources,Predicates.and(Predicates.notNull(),typeSpecificFilters(),RestrictedTypes.filterPrivileged()))) {
          return false;
        }
        for (        final CloudMetadata resource : resources) {
          final Tag example=TagSupport.fromResource(resource).example(resource,ownerFullName,null,null);
          if (Entities.count(example) + resourceTags.size() > MAX_TAGS_PER_RESOURCE) {
            return false;
          }
        }
        for (        final CloudMetadata resource : resources) {
          for (          final ResourceTag resourceTag : resourceTags) {
            final String key=Strings.nullToEmpty(resourceTag.getKey()).trim();
            final String value=Strings.nullToEmpty(resourceTag.getValue()).trim();
            TagSupport.fromResource(resource).createOrUpdate(resource,ownerFullName,key,value);
          }
        }
        return true;
      }
    }
;
    reply.set_return(Entities.asTransaction(Tag.class,creator).apply(null));
  }
  return reply;
}

Fixed version (ground truth):
public CreateTagsResponseType createTags(final CreateTagsType request) throws EucalyptusCloudException {
  final CreateTagsResponseType reply=request.getReply();
  reply.set_return(false);
  final Context context=Contexts.lookup();
  final UserFullName userFullName=context.getUserFullName();
  final AccountFullName accountFullName=userFullName.asAccountFullName();
  final List<String> resourceIds=Objects.firstNonNull(request.getResourcesSet(),Collections.<String>emptyList());
  final List<ResourceTag> resourceTags=Objects.firstNonNull(request.getTagSet(),Collections.<ResourceTag>emptyList());
  for (  final ResourceTag resourceTag : resourceTags) {
    final String key=resourceTag.getKey();
    final String value=Strings.nullToEmpty(resourceTag.getValue()).trim();
    if (Strings.isNullOrEmpty(key) || key.trim().length() > 128 || isReserved(key)) {
      throw new InvalidParameterValueException("String_Node_Str" + reservedPrefixes + "String_Node_Str"+ key);
    }
    if (value.length() > 256 || isReserved(key)) {
      throw new InvalidParameterValueException("String_Node_Str" + reservedPrefixes + "String_Node_Str"+ value);
    }
  }
  if (resourceTags.size() > 0 && resourceIds.size() > 0) {
    final Predicate<Void> creator=new Predicate<Void>(){
      @Override public boolean apply(      final Void v){
        final List<CloudMetadata> resources=Lists.transform(resourceIds,resourceLookup());
        if (!Iterables.all(resources,Predicates.and(Predicates.notNull(),typeSpecificFilters(),RestrictedTypes.filterPrivileged()))) {
          return false;
        }
        for (        final CloudMetadata resource : resources) {
          for (          final ResourceTag resourceTag : resourceTags) {
            final String key=Strings.nullToEmpty(resourceTag.getKey()).trim();
            final String value=Strings.nullToEmpty(resourceTag.getValue()).trim();
            TagSupport.fromResource(resource).createOrUpdate(resource,userFullName,key,value);
          }
          if (TagSupport.fromResource(resource).count(resource,accountFullName) > MAX_TAGS_PER_RESOURCE) {
            throw new TagLimitException();
          }
        }
        return true;
      }
    }
;
    try {
      reply.set_return(Entities.asTransaction(Tag.class,creator).apply(null));
    }
 catch (    TagLimitException e) {
      reply.set_return(false);
    }
  }
  return reply;
}