Program: 49365
Project: 49365
Buggy source:
public Subscription importObject(ObjectMapper mapper,Reader reader,Owner owner,Map<String,Product> productsById,ConsumerDto consumer,Meta meta) throws IOException, SyncDataFormatException {
  Entitlement entitlement=mapper.readValue(reader,Entitlement.class);
  Subscription subscription=new Subscription();
  subscription.setUpstreamPoolId(entitlement.getPool().getId());
  subscription.setUpstreamEntitlementId(entitlement.getId());
  subscription.setUpstreamConsumerId(consumer.getUuid());
  subscription.setOwner(owner);
  subscription.setStartDate(entitlement.getStartDate());
  subscription.setEndDate(entitlement.getEndDate());
  subscription.setAccountNumber(entitlement.getPool().getAccountNumber());
  subscription.setContractNumber(entitlement.getPool().getContractNumber());
  subscription.setOrderNumber(entitlement.getPool().getOrderNumber());
  subscription.setQuantity(entitlement.getQuantity().longValue());
  for (  Branding b : entitlement.getPool().getBranding()) {
    subscription.getBranding().add(new Branding(b.getProductId(),b.getType(),b.getName()));
  }
  subscription.setProduct(findProduct(productsById,entitlement.getProductId()));
  String cdnLabel=meta.getCdnLabel();
  if (!StringUtils.isBlank(cdnLabel)) {
    Cdn cdn=cdnCurator.lookupByLabel(cdnLabel);
    if (cdn != null) {
      subscription.setCdn(cdn);
    }
  }
  Set<Product> products=new HashSet<Product>();
  for (  Product providedProduct : entitlement.getPool().getProvidedProducts()) {
    products.add(findProduct(productsById,providedProduct.getId()));
  }
  subscription.setProvidedProducts(products);
  if (entitlement.getPool().getDerivedProduct() != null) {
    subscription.setDerivedProduct(findProduct(productsById,entitlement.getPool().getDerivedProduct().getId()));
  }
  Set<Product> subProvProds=new HashSet<Product>();
  for (  Product subProvProd : entitlement.getPool().getDerivedProvidedProducts()) {
    subProvProds.add(findProduct(productsById,subProvProd.getId()));
  }
  subscription.setDerivedProvidedProducts(subProvProds);
  Set<EntitlementCertificate> certs=entitlement.getCertificates();
  int entcnt=0;
  for (  EntitlementCertificate cert : certs) {
    entcnt++;
    CertificateSerial cs=new CertificateSerial();
    cs.setCollected(cert.getSerial().isCollected());
    cs.setExpiration(cert.getSerial().getExpiration());
    cs.setUpdated(cert.getSerial().getUpdated());
    cs.setCreated(cert.getSerial().getCreated());
    csCurator.create(cs);
    SubscriptionsCertificate sc=new SubscriptionsCertificate();
    sc.setKey(cert.getKey());
    sc.setCertAsBytes(cert.getCertAsBytes());
    sc.setSerial(cs);
    subscription.setCertificate(sc);
  }
  if (entcnt > 1) {
    log.error("String_Node_Str");
  }
  return subscription;
}

Fixed version (ground truth):
public Subscription importObject(ObjectMapper mapper,Reader reader,Owner owner,Map<String,Product> productsById,ConsumerDto consumer,Meta meta) throws IOException, SyncDataFormatException {
  Entitlement entitlement=mapper.readValue(reader,Entitlement.class);
  Subscription subscription=new Subscription();
  subscription.setId(Util.generateDbUUID());
  subscription.setUpstreamPoolId(entitlement.getPool().getId());
  subscription.setUpstreamEntitlementId(entitlement.getId());
  subscription.setUpstreamConsumerId(consumer.getUuid());
  subscription.setOwner(owner);
  subscription.setStartDate(entitlement.getStartDate());
  subscription.setEndDate(entitlement.getEndDate());
  subscription.setAccountNumber(entitlement.getPool().getAccountNumber());
  subscription.setContractNumber(entitlement.getPool().getContractNumber());
  subscription.setOrderNumber(entitlement.getPool().getOrderNumber());
  subscription.setQuantity(entitlement.getQuantity().longValue());
  for (  Branding b : entitlement.getPool().getBranding()) {
    subscription.getBranding().add(new Branding(b.getProductId(),b.getType(),b.getName()));
  }
  subscription.setProduct(findProduct(productsById,entitlement.getProductId()));
  String cdnLabel=meta.getCdnLabel();
  if (!StringUtils.isBlank(cdnLabel)) {
    Cdn cdn=cdnCurator.lookupByLabel(cdnLabel);
    if (cdn != null) {
      subscription.setCdn(cdn);
    }
  }
  Set<Product> products=new HashSet<Product>();
  for (  Product providedProduct : entitlement.getPool().getProvidedProducts()) {
    products.add(findProduct(productsById,providedProduct.getId()));
  }
  subscription.setProvidedProducts(products);
  if (entitlement.getPool().getDerivedProduct() != null) {
    subscription.setDerivedProduct(findProduct(productsById,entitlement.getPool().getDerivedProduct().getId()));
  }
  Set<Product> subProvProds=new HashSet<Product>();
  for (  Product subProvProd : entitlement.getPool().getDerivedProvidedProducts()) {
    subProvProds.add(findProduct(productsById,subProvProd.getId()));
  }
  subscription.setDerivedProvidedProducts(subProvProds);
  Set<EntitlementCertificate> certs=entitlement.getCertificates();
  int entcnt=0;
  for (  EntitlementCertificate cert : certs) {
    entcnt++;
    CertificateSerial cs=new CertificateSerial();
    cs.setCollected(cert.getSerial().isCollected());
    cs.setExpiration(cert.getSerial().getExpiration());
    cs.setUpdated(cert.getSerial().getUpdated());
    cs.setCreated(cert.getSerial().getCreated());
    csCurator.create(cs);
    SubscriptionsCertificate sc=new SubscriptionsCertificate();
    sc.setKey(cert.getKey());
    sc.setCertAsBytes(cert.getCertAsBytes());
    sc.setSerial(cs);
    subscription.setCertificate(sc);
  }
  if (entcnt > 1) {
    log.error("String_Node_Str");
  }
  return subscription;
}