Program: 176659
Project: 176659
Buggy source:
/** 
 * Sets the column family properties.
 * @param cfDef the cf def
 * @param cFProperties the c f properties
 */
private void setColumnFamilyProperties(CfDef cfDef,Properties cFProperties,StringBuilder builder){
  if ((cfDef != null && cFProperties != null) || (builder != null && cFProperties != null)) {
    if (builder != null) {
      builder.append(CQLTranslator.WITH_CLAUSE);
    }
    String keyValidationClass=cFProperties.getProperty(CassandraConstants.KEY_VALIDATION_CLASS);
    if (keyValidationClass != null) {
      if (builder != null) {
      }
 else {
        cfDef.setKey_validation_class(keyValidationClass);
      }
    }
    String compactionStrategy=cFProperties.getProperty(CassandraConstants.COMPACTION_STRATEGY);
    if (compactionStrategy != null) {
      if (builder != null) {
        String strategy_class=CQLTranslator.getKeyword(CassandraConstants.COMPACTION_STRATEGY);
        builder.append(strategy_class);
        builder.append(CQLTranslator.EQ_CLAUSE);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(compactionStrategy);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(CQLTranslator.AND_CLAUSE);
      }
 else {
        cfDef.setCompaction_strategy(compactionStrategy);
      }
    }
    String comparatorType=cFProperties.getProperty(CassandraConstants.COMPARATOR_TYPE);
    if (comparatorType != null) {
      if (builder != null) {
      }
 else {
        cfDef.setComparator_type(comparatorType);
      }
    }
    String subComparatorType=cFProperties.getProperty(CassandraConstants.SUB_COMPARATOR_TYPE);
    if (subComparatorType != null && ColumnFamilyType.valueOf(cfDef.getColumn_type()) == ColumnFamilyType.Super) {
      if (builder != null) {
      }
 else {
        cfDef.setSubcomparator_type(subComparatorType);
      }
    }
    String replicateOnWrite=cFProperties.getProperty(CassandraConstants.REPLICATE_ON_WRITE);
    if (builder != null) {
      appendPropertyToBuilder(builder,replicateOnWrite,CassandraConstants.REPLICATE_ON_WRITE);
    }
 else {
      cfDef.setReplicate_on_write(Boolean.parseBoolean(replicateOnWrite));
    }
    String maxCompactionThreshold=cFProperties.getProperty(CassandraConstants.MAX_COMPACTION_THRESHOLD);
    if (maxCompactionThreshold != null) {
      try {
        if (builder != null) {
        }
 else {
          cfDef.setMax_compaction_threshold(Integer.parseInt(maxCompactionThreshold));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String minCompactionThreshold=cFProperties.getProperty(CassandraConstants.MIN_COMPACTION_THRESHOLD);
    if (minCompactionThreshold != null) {
      try {
        if (builder != null) {
        }
 else {
          cfDef.setMin_compaction_threshold(Integer.parseInt(minCompactionThreshold));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String comment=cFProperties.getProperty(CassandraConstants.COMMENT);
    if (comment != null) {
      if (builder != null) {
        String comment_Str=CQLTranslator.getKeyword(CassandraConstants.COMMENT);
        builder.append(comment_Str);
        builder.append(CQLTranslator.EQ_CLAUSE);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(comment);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(CQLTranslator.AND_CLAUSE);
      }
 else {
        cfDef.setComment(comment);
      }
    }
    String id=cFProperties.getProperty(CassandraConstants.ID);
    if (id != null) {
      try {
        if (builder != null) {
        }
 else {
          cfDef.setId(Integer.parseInt(id));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String gcGraceSeconds=cFProperties.getProperty(CassandraConstants.GC_GRACE_SECONDS);
    if (gcGraceSeconds != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,gcGraceSeconds,CassandraConstants.GC_GRACE_SECONDS);
        }
 else {
          cfDef.setGc_grace_seconds(Integer.parseInt(gcGraceSeconds));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String caching=cFProperties.getProperty(CassandraConstants.CACHING);
    if (caching != null) {
      if (builder != null) {
        appendPropertyToBuilder(builder,caching,CassandraConstants.CACHING);
      }
 else {
        cfDef.setCaching(caching);
      }
    }
    String bloomFilterFpChance=cFProperties.getProperty(CassandraConstants.BLOOM_FILTER_FP_CHANCE);
    if (bloomFilterFpChance != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,bloomFilterFpChance,CassandraConstants.BLOOM_FILTER_FP_CHANCE);
        }
 else {
          cfDef.setBloom_filter_fp_chance(Double.parseDouble(bloomFilterFpChance));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String readRepairChance=cFProperties.getProperty(CassandraConstants.READ_REPAIR_CHANCE);
    if (readRepairChance != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,readRepairChance,CassandraConstants.READ_REPAIR_CHANCE);
        }
 else {
          cfDef.setRead_repair_chance(Double.parseDouble(readRepairChance));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String dclocalReadRepairChance=cFProperties.getProperty(CassandraConstants.DCLOCAL_READ_REPAIR_CHANCE);
    if (dclocalReadRepairChance != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,dclocalReadRepairChance,CassandraConstants.DCLOCAL_READ_REPAIR_CHANCE);
        }
 else {
          cfDef.setDclocal_read_repair_chance(Double.parseDouble(dclocalReadRepairChance));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    if (builder != null && StringUtils.contains(builder.toString(),CQLTranslator.AND_CLAUSE)) {
      builder.delete(builder.lastIndexOf(CQLTranslator.AND_CLAUSE),builder.length());
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the column family properties.
 * @param cfDef the cf def
 * @param cFProperties the c f properties
 */
private void setColumnFamilyProperties(CfDef cfDef,Properties cFProperties,StringBuilder builder){
  if ((cfDef != null && cFProperties != null) || (builder != null && cFProperties != null)) {
    if (builder != null) {
      builder.append(CQLTranslator.WITH_CLAUSE);
    }
    String keyValidationClass=cFProperties.getProperty(CassandraConstants.KEY_VALIDATION_CLASS);
    if (keyValidationClass != null) {
      if (builder != null) {
      }
 else {
        cfDef.setKey_validation_class(keyValidationClass);
      }
    }
    String compactionStrategy=cFProperties.getProperty(CassandraConstants.COMPACTION_STRATEGY);
    if (compactionStrategy != null) {
      if (builder != null) {
        String strategy_class=CQLTranslator.getKeyword(CassandraConstants.COMPACTION_STRATEGY);
        builder.append(strategy_class);
        builder.append(CQLTranslator.EQ_CLAUSE);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(compactionStrategy);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(CQLTranslator.AND_CLAUSE);
      }
 else {
        cfDef.setCompaction_strategy(compactionStrategy);
      }
    }
    String comparatorType=cFProperties.getProperty(CassandraConstants.COMPARATOR_TYPE);
    if (comparatorType != null) {
      if (builder != null) {
      }
 else {
        cfDef.setComparator_type(comparatorType);
      }
    }
    String subComparatorType=cFProperties.getProperty(CassandraConstants.SUBCOMPARATOR_TYPE);
    if (subComparatorType != null && ColumnFamilyType.valueOf(cfDef.getColumn_type()) == ColumnFamilyType.Super) {
      if (builder != null) {
      }
 else {
        cfDef.setSubcomparator_type(subComparatorType);
      }
    }
    String replicateOnWrite=cFProperties.getProperty(CassandraConstants.REPLICATE_ON_WRITE);
    if (builder != null) {
      appendPropertyToBuilder(builder,replicateOnWrite,CassandraConstants.REPLICATE_ON_WRITE);
    }
 else {
      cfDef.setReplicate_on_write(Boolean.parseBoolean(replicateOnWrite));
    }
    String maxCompactionThreshold=cFProperties.getProperty(CassandraConstants.MAX_COMPACTION_THRESHOLD);
    if (maxCompactionThreshold != null) {
      try {
        if (builder != null) {
        }
 else {
          cfDef.setMax_compaction_threshold(Integer.parseInt(maxCompactionThreshold));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String minCompactionThreshold=cFProperties.getProperty(CassandraConstants.MIN_COMPACTION_THRESHOLD);
    if (minCompactionThreshold != null) {
      try {
        if (builder != null) {
        }
 else {
          cfDef.setMin_compaction_threshold(Integer.parseInt(minCompactionThreshold));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String comment=cFProperties.getProperty(CassandraConstants.COMMENT);
    if (comment != null) {
      if (builder != null) {
        String comment_Str=CQLTranslator.getKeyword(CassandraConstants.COMMENT);
        builder.append(comment_Str);
        builder.append(CQLTranslator.EQ_CLAUSE);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(comment);
        builder.append(CQLTranslator.QUOTE_STR);
        builder.append(CQLTranslator.AND_CLAUSE);
      }
 else {
        cfDef.setComment(comment);
      }
    }
    String id=cFProperties.getProperty(CassandraConstants.ID);
    if (id != null) {
      try {
        if (builder != null) {
        }
 else {
          cfDef.setId(Integer.parseInt(id));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String gcGraceSeconds=cFProperties.getProperty(CassandraConstants.GC_GRACE_SECONDS);
    if (gcGraceSeconds != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,gcGraceSeconds,CassandraConstants.GC_GRACE_SECONDS);
        }
 else {
          cfDef.setGc_grace_seconds(Integer.parseInt(gcGraceSeconds));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String caching=cFProperties.getProperty(CassandraConstants.CACHING);
    if (caching != null) {
      if (builder != null) {
        appendPropertyToBuilder(builder,caching,CassandraConstants.CACHING);
      }
 else {
        cfDef.setCaching(caching);
      }
    }
    String bloomFilterFpChance=cFProperties.getProperty(CassandraConstants.BLOOM_FILTER_FP_CHANCE);
    if (bloomFilterFpChance != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,bloomFilterFpChance,CassandraConstants.BLOOM_FILTER_FP_CHANCE);
        }
 else {
          cfDef.setBloom_filter_fp_chance(Double.parseDouble(bloomFilterFpChance));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String readRepairChance=cFProperties.getProperty(CassandraConstants.READ_REPAIR_CHANCE);
    if (readRepairChance != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,readRepairChance,CassandraConstants.READ_REPAIR_CHANCE);
        }
 else {
          cfDef.setRead_repair_chance(Double.parseDouble(readRepairChance));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    String dclocalReadRepairChance=cFProperties.getProperty(CassandraConstants.DCLOCAL_READ_REPAIR_CHANCE);
    if (dclocalReadRepairChance != null) {
      try {
        if (builder != null) {
          appendPropertyToBuilder(builder,dclocalReadRepairChance,CassandraConstants.DCLOCAL_READ_REPAIR_CHANCE);
        }
 else {
          cfDef.setDclocal_read_repair_chance(Double.parseDouble(dclocalReadRepairChance));
        }
      }
 catch (      NumberFormatException nfe) {
        log.error("String_Node_Str");
        throw new SchemaGenerationException(nfe);
      }
    }
    if (builder != null && StringUtils.contains(builder.toString(),CQLTranslator.AND_CLAUSE)) {
      builder.delete(builder.lastIndexOf(CQLTranslator.AND_CLAUSE),builder.length());
    }
  }
}