Program: 49244
Project: 49244
Buggy source:
/** 
 * Removes all content with the provided UUIDs from the given owner.
 * @param owner The owner from which to remove content
 * @param contentUuids A collection of UUIDs representing the content to remove
 * @param regenerateEntitlementCerts Whether or not changes made to the content should trigger the regeneration of entitlement certificates for affected consumers
 * @throws IllegalArgumentException if owner is null
 */
public void removeContentByUuids(Owner owner,Collection<String> contentUuids,boolean regenerateEntitlementCerts){
  if (owner == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (contentUuids != null && !contentUuids.isEmpty()) {
    log.debug("String_Node_Str",contentUuids);
    List<Product> affectedProducts=this.productCurator.getProductsByContentUuids(owner,contentUuids).list();
    if (!affectedProducts.isEmpty()) {
      log.debug("String_Node_Str",affectedProducts.size());
      if (!(contentUuids instanceof Set)) {
        contentUuids=new HashSet<String>(contentUuids);
      }
      Map<String,Content> affectedProductsContent=new HashMap<String,Content>();
      for (      Content content : this.contentCurator.getContentByProducts(affectedProducts)) {
        if (!contentUuids.contains(content.getUuid())) {
          affectedProductsContent.put(content.getId(),content);
        }
      }
      Map<String,ProductData> affectedProductData=new HashMap<String,ProductData>();
      for (      Product product : affectedProducts) {
        ProductData pdata=product.toDTO();
        Iterator<ProductContentData> pcd=pdata.getProductContent().iterator();
        while (pcd.hasNext()) {
          ContentData cdata=pcd.next().getContent();
          if (!affectedProductsContent.containsKey(cdata.getId())) {
            pcd.remove();
          }
        }
      }
      log.debug("String_Node_Str",affectedProductData);
      this.productManager.importProducts(owner,affectedProductData,affectedProductsContent);
      if (regenerateEntitlementCerts) {
        this.entitlementCertGenerator.regenerateCertificatesOf(Arrays.asList(owner),affectedProducts,true);
      }
    }
    log.debug("String_Node_Str");
    this.ownerContentCurator.removeOwnerContentReferences(owner,contentUuids);
  }
}

Fixed version (ground truth):
/** 
 * Removes all content with the provided UUIDs from the given owner.
 * @param owner The owner from which to remove content
 * @param contentUuids A collection of UUIDs representing the content to remove
 * @param regenerateEntitlementCerts Whether or not changes made to the content should trigger the regeneration of entitlement certificates for affected consumers
 * @throws IllegalArgumentException if owner is null
 */
public void removeContentByUuids(Owner owner,Collection<String> contentUuids,boolean regenerateEntitlementCerts){
  if (owner == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (contentUuids != null && !contentUuids.isEmpty()) {
    log.debug("String_Node_Str",contentUuids);
    List<Product> affectedProducts=this.productCurator.getProductsByContentUuids(owner,contentUuids).list();
    if (!affectedProducts.isEmpty()) {
      log.debug("String_Node_Str",affectedProducts.size());
      if (!(contentUuids instanceof Set)) {
        contentUuids=new HashSet<String>(contentUuids);
      }
      Map<String,Content> affectedProductsContent=new HashMap<String,Content>();
      for (      Content content : this.contentCurator.getContentByProducts(affectedProducts)) {
        if (!contentUuids.contains(content.getUuid())) {
          affectedProductsContent.put(content.getId(),content);
        }
      }
      Map<String,ProductData> affectedProductData=new HashMap<String,ProductData>();
      for (      Product product : affectedProducts) {
        ProductData pdata=product.toDTO();
        Iterator<ProductContentData> pcd=pdata.getProductContent().iterator();
        while (pcd.hasNext()) {
          ContentData cdata=pcd.next().getContent();
          if (!affectedProductsContent.containsKey(cdata.getId())) {
            pcd.remove();
          }
        }
        affectedProductData.put(pdata.getId(),pdata);
      }
      log.debug("String_Node_Str",affectedProductData);
      this.productManager.importProducts(owner,affectedProductData,affectedProductsContent);
      if (regenerateEntitlementCerts) {
        this.entitlementCertGenerator.regenerateCertificatesOf(Arrays.asList(owner),affectedProducts,true);
      }
    }
    this.ownerContentCurator.removeOwnerContentReferences(owner,contentUuids);
  }
}