Program: 49294
Project: 49294
Buggy source:
private void postBindVirtLimit(PoolManager poolManager,Consumer c,Map<String,Entitlement> entitlementMap,Map<String,Map<String,String>> attributeMaps,List<Pool> subPoolsForStackIds){
  Set<String> stackIdsThathaveSubPools=new HashSet<String>();
  if (subPoolsForStackIds != null && !subPoolsForStackIds.isEmpty()) {
    for (    Pool pool : subPoolsForStackIds) {
      stackIdsThathaveSubPools.add(pool.getSourceStackId());
    }
  }
  log.debug("String_Node_Str");
  boolean consumerFactExpression=!c.getType().isManifest() && !"String_Node_Str".equalsIgnoreCase(c.getFact("String_Node_Str"));
  boolean isStandalone=config.getBoolean(ConfigProperties.STANDALONE);
  List<Pool> createHostRestrictedPoolFor=new ArrayList<Pool>();
  List<Entitlement> decrementHostedBonusPoolQuantityFor=new ArrayList<Entitlement>();
  for (  Entitlement entitlement : entitlementMap.values()) {
    Pool pool=entitlement.getPool();
    Map<String,String> attributes=attributeMaps.get(pool.getId());
    boolean hostLimited=attributes.containsKey("String_Node_Str") && attributes.get("String_Node_Str").equals("String_Node_Str");
    if (consumerFactExpression && (isStandalone || hostLimited)) {
      String virtLimit=attributes.get("String_Node_Str");
      String stackId=attributes.get("String_Node_Str");
      boolean createSubPool=stackId == null || stackIdsThathaveSubPools.contains(stackId);
      if (createSubPool) {
        log.debug("String_Node_Str",pool);
        try {
          int virtQuantity=Integer.parseInt(virtLimit);
          if (virtQuantity <= 0) {
            continue;
          }
        }
 catch (        NumberFormatException nfe) {
          if (!"String_Node_Str".equals(virtLimit)) {
            continue;
          }
        }
        createHostRestrictedPoolFor.add(pool);
      }
 else {
        log.debug("String_Node_Str",pool);
      }
    }
 else {
      decrementHostedBonusPoolQuantityFor.add(entitlement);
    }
  }
  if (createHostRestrictedPoolFor != null && !createHostRestrictedPoolFor.isEmpty()) {
    log.debug("String_Node_Str",createHostRestrictedPoolFor);
    PoolHelper.createHostRestrictedPools(poolManager,c,createHostRestrictedPoolFor,entitlementMap,attributeMaps);
  }
  if (decrementHostedBonusPoolQuantityFor != null && !decrementHostedBonusPoolQuantityFor.isEmpty()) {
    log.debug("String_Node_Str",decrementHostedBonusPoolQuantityFor);
    decrementHostedBonusPoolQuantity(poolManager,c,decrementHostedBonusPoolQuantityFor,attributeMaps);
  }
}

Fixed version (ground truth):
private void postBindVirtLimit(PoolManager poolManager,Consumer c,Map<String,Entitlement> entitlementMap,Map<String,Map<String,String>> attributeMaps,List<Pool> subPoolsForStackIds){
  Set<String> stackIdsThathaveSubPools=new HashSet<String>();
  if (subPoolsForStackIds != null && !subPoolsForStackIds.isEmpty()) {
    for (    Pool pool : subPoolsForStackIds) {
      stackIdsThathaveSubPools.add(pool.getSourceStackId());
    }
  }
  log.debug("String_Node_Str");
  boolean consumerFactExpression=!c.getType().isManifest() && !"String_Node_Str".equalsIgnoreCase(c.getFact("String_Node_Str"));
  boolean isStandalone=config.getBoolean(ConfigProperties.STANDALONE);
  List<Pool> createHostRestrictedPoolFor=new ArrayList<Pool>();
  List<Entitlement> decrementHostedBonusPoolQuantityFor=new ArrayList<Entitlement>();
  for (  Entitlement entitlement : entitlementMap.values()) {
    Pool pool=entitlement.getPool();
    Map<String,String> attributes=attributeMaps.get(pool.getId());
    boolean hostLimited=attributes.containsKey("String_Node_Str") && attributes.get("String_Node_Str").equals("String_Node_Str");
    if (consumerFactExpression && (isStandalone || hostLimited)) {
      String virtLimit=attributes.get("String_Node_Str");
      String stackId=attributes.get("String_Node_Str");
      boolean createSubPool=stackId == null || !stackIdsThathaveSubPools.contains(stackId);
      if (createSubPool) {
        log.debug("String_Node_Str",pool);
        try {
          int virtQuantity=Integer.parseInt(virtLimit);
          if (virtQuantity <= 0) {
            continue;
          }
        }
 catch (        NumberFormatException nfe) {
          if (!"String_Node_Str".equals(virtLimit)) {
            continue;
          }
        }
        createHostRestrictedPoolFor.add(pool);
      }
 else {
        log.debug("String_Node_Str",pool);
      }
    }
 else {
      decrementHostedBonusPoolQuantityFor.add(entitlement);
    }
  }
  if (createHostRestrictedPoolFor != null && !createHostRestrictedPoolFor.isEmpty()) {
    log.debug("String_Node_Str",createHostRestrictedPoolFor);
    PoolHelper.createHostRestrictedPools(poolManager,c,createHostRestrictedPoolFor,entitlementMap,attributeMaps);
  }
  if (decrementHostedBonusPoolQuantityFor != null && !decrementHostedBonusPoolQuantityFor.isEmpty()) {
    log.debug("String_Node_Str",decrementHostedBonusPoolQuantityFor);
    decrementHostedBonusPoolQuantity(poolManager,c,decrementHostedBonusPoolQuantityFor,attributeMaps);
  }
}