Program: 80170
Project: 80170
Buggy source:
/** 
 * Check if keyspace already exists. If not, create it. In this method, we also utilize Hector's   {@link me.prettyprint.cassandra.model.ConfigurableConsistencyLevel} logic. It is set by passing a  {@link me.prettyprint.cassandra.model.ConfigurableConsistencyLevel} object right when the  {@link me.prettyprint.hector.api.Keyspace} is created. If we cannot find a consistency level within <code>gora.properites</code>,  then column family consistency level is set to QUORUM (by default) which permits  consistency to wait for a quorum of replicas to respond regardless of data center. QUORUM is Hector Client's default setting and we respect that here as well.
 * @see http://hector-client.github.io/hector/build/html/content/consistency_level.html
 */
public void checkKeyspace(){
  KeyspaceDefinition keyspaceDefinition=this.cluster.describeKeyspace(this.cassandraMapping.getKeyspaceName());
  if (keyspaceDefinition == null) {
    List<ColumnFamilyDefinition> columnFamilyDefinitions=this.cassandraMapping.getColumnFamilyDefinitions();
    for (    ColumnFamilyDefinition cfDef : columnFamilyDefinitions) {
      cfDef.setComparatorType(ComparatorType.BYTESTYPE);
    }
    keyspaceDefinition=HFactory.createKeyspaceDefinition(this.cassandraMapping.getKeyspaceName(),this.cassandraMapping.getKeyspaceReplicationStrategy(),this.cassandraMapping.getKeyspaceReplicationFactor(),columnFamilyDefinitions);
    this.cluster.addKeyspace(keyspaceDefinition,true);
    ConfigurableConsistencyLevel ccl=new ConfigurableConsistencyLevel();
    Map<String,HConsistencyLevel> clmap=getConsisLevelForColFams(columnFamilyDefinitions);
    ccl.setReadCfConsistencyLevels(clmap);
    ccl.setWriteCfConsistencyLevels(clmap);
    String opConsisLvl=(readOpConsLvl != null || !readOpConsLvl.isEmpty()) ? readOpConsLvl : DEFAULT_HECTOR_CONSIS_LEVEL;
    ccl.setDefaultReadConsistencyLevel(HConsistencyLevel.valueOf(opConsisLvl));
    LOG.debug("String_Node_Str" + opConsisLvl + "String_Node_Str");
    opConsisLvl=(writeOpConsLvl != null || !writeOpConsLvl.isEmpty()) ? writeOpConsLvl : DEFAULT_HECTOR_CONSIS_LEVEL;
    ccl.setDefaultWriteConsistencyLevel(HConsistencyLevel.valueOf(opConsisLvl));
    LOG.debug("String_Node_Str" + opConsisLvl + "String_Node_Str");
    HFactory.createKeyspace("String_Node_Str",this.cluster,ccl);
    keyspaceDefinition=null;
  }
 else {
    List<ColumnFamilyDefinition> cfDefs=keyspaceDefinition.getCfDefs();
    if (cfDefs == null || cfDefs.size() == 0) {
      LOG.warn(keyspaceDefinition.getName() + "String_Node_Str");
    }
 else {
      for (      ColumnFamilyDefinition cfDef : cfDefs) {
        ComparatorType comparatorType=cfDef.getComparatorType();
        if (!comparatorType.equals(ComparatorType.BYTESTYPE)) {
          LOG.warn("String_Node_Str" + cfDef.getName() + "String_Node_Str"+ comparatorType.getTypeName()+ "String_Node_Str");
        }
 else {
          LOG.debug("String_Node_Str" + cfDef.getName() + "String_Node_Str"+ comparatorType.getTypeName()+ "String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Check if keyspace already exists. If not, create it. In this method, we also utilize Hector's  {@link me.prettyprint.cassandra.model.ConfigurableConsistencyLevel} logic.It is set by passing a {@link me.prettyprint.cassandra.model.ConfigurableConsistencyLevel} object rightwhen the  {@link me.prettyprint.hector.api.Keyspace} is created.If we cannot find a consistency level within <code>gora.properites</code>, then column family consistency level is set to QUORUM (by default) which permits consistency to wait for a quorum of replicas to respond regardless of data center. QUORUM is Hector Client's default setting and we respect that here as well.
 * @see <a href="http://hector-client.github.io/hector/build/html/content/consistency_level.html">Consistency Level</a>
 */
public void checkKeyspace(){
  KeyspaceDefinition keyspaceDefinition=this.cluster.describeKeyspace(this.cassandraMapping.getKeyspaceName());
  if (keyspaceDefinition == null) {
    List<ColumnFamilyDefinition> columnFamilyDefinitions=this.cassandraMapping.getColumnFamilyDefinitions();
    for (    ColumnFamilyDefinition cfDef : columnFamilyDefinitions) {
      cfDef.setComparatorType(ComparatorType.BYTESTYPE);
    }
    keyspaceDefinition=HFactory.createKeyspaceDefinition(this.cassandraMapping.getKeyspaceName(),this.cassandraMapping.getKeyspaceReplicationStrategy(),this.cassandraMapping.getKeyspaceReplicationFactor(),columnFamilyDefinitions);
    this.cluster.addKeyspace(keyspaceDefinition,true);
    ConfigurableConsistencyLevel ccl=new ConfigurableConsistencyLevel();
    Map<String,HConsistencyLevel> clmap=getConsisLevelForColFams(columnFamilyDefinitions);
    ccl.setReadCfConsistencyLevels(clmap);
    ccl.setWriteCfConsistencyLevels(clmap);
    String opConsisLvl=(readOpConsLvl != null || !readOpConsLvl.isEmpty()) ? readOpConsLvl : DEFAULT_HECTOR_CONSIS_LEVEL;
    ccl.setDefaultReadConsistencyLevel(HConsistencyLevel.valueOf(opConsisLvl));
    LOG.debug("String_Node_Str" + opConsisLvl + "String_Node_Str");
    opConsisLvl=(writeOpConsLvl != null || !writeOpConsLvl.isEmpty()) ? writeOpConsLvl : DEFAULT_HECTOR_CONSIS_LEVEL;
    ccl.setDefaultWriteConsistencyLevel(HConsistencyLevel.valueOf(opConsisLvl));
    LOG.debug("String_Node_Str" + opConsisLvl + "String_Node_Str");
    HFactory.createKeyspace("String_Node_Str",this.cluster,ccl);
    keyspaceDefinition=null;
  }
 else {
    List<ColumnFamilyDefinition> cfDefs=keyspaceDefinition.getCfDefs();
    if (cfDefs == null || cfDefs.size() == 0) {
      LOG.warn(keyspaceDefinition.getName() + "String_Node_Str");
    }
 else {
      for (      ColumnFamilyDefinition cfDef : cfDefs) {
        ComparatorType comparatorType=cfDef.getComparatorType();
        if (!comparatorType.equals(ComparatorType.BYTESTYPE)) {
          LOG.warn("String_Node_Str" + cfDef.getName() + "String_Node_Str"+ comparatorType.getTypeName()+ "String_Node_Str");
        }
 else {
          LOG.debug("String_Node_Str" + cfDef.getName() + "String_Node_Str"+ comparatorType.getTypeName()+ "String_Node_Str");
        }
      }
    }
  }
}