Program: 47752
Project: 47752
Buggy source:
/** 
 * Refreshes the encapsulated meta data for the column family.
 * @param conn the connection to cassandra to use for refreshing the metadata
 * @throws Exception if a problem occurs during connection or whenfetching meta data
 */
public void refresh(CassandraConnection conn) throws Exception {
  m_schemaDescription=new StringBuffer();
  KsDef keySpace=conn.describeKeyspace();
  List<CfDef> colFams=null;
  if (keySpace != null) {
    colFams=keySpace.getCf_defs();
  }
 else {
    throw new Exception("String_Node_Str" + conn.m_keyspaceName + "String_Node_Str");
  }
  CfDef colDefs=null;
  for (  CfDef fam : colFams) {
    String columnFamilyName=fam.getName();
    if (columnFamilyName.equals(m_columnFamilyName)) {
      m_schemaDescription.append("String_Node_Str" + m_columnFamilyName);
      m_keyValidator=fam.getKey_validation_class();
      m_columnComparator=fam.getComparator_type();
      m_defaultValidationClass=fam.getDefault_validation_class();
      m_schemaDescription.append("String_Node_Str" + m_keyValidator.substring(m_keyValidator.lastIndexOf("String_Node_Str") + 1,m_keyValidator.length()));
      m_schemaDescription.append("String_Node_Str" + m_columnComparator.substring(m_columnComparator.lastIndexOf("String_Node_Str") + 1,m_columnComparator.length()));
      m_schemaDescription.append("String_Node_Str" + m_defaultValidationClass.substring(m_defaultValidationClass.lastIndexOf("String_Node_Str") + 1,m_defaultValidationClass.length()));
      m_schemaDescription.append("String_Node_Str" + fam.getRow_cache_size());
      m_schemaDescription.append("String_Node_Str" + fam.getRow_cache_save_period_in_seconds());
      m_schemaDescription.append("String_Node_Str" + fam.getKey_cache_size());
      m_schemaDescription.append("String_Node_Str" + fam.getKey_cache_save_period_in_seconds());
      m_schemaDescription.append("String_Node_Str" + fam.getRead_repair_chance());
      m_schemaDescription.append("String_Node_Str" + fam.getGc_grace_seconds());
      m_schemaDescription.append("String_Node_Str" + fam.getMin_compaction_threshold());
      m_schemaDescription.append("String_Node_Str" + fam.getMax_compaction_threshold());
      m_schemaDescription.append("String_Node_Str" + fam.replicate_on_write);
      String rowCacheP=fam.getRow_cache_provider();
      m_schemaDescription.append("String_Node_Str" + rowCacheP.substring(rowCacheP.lastIndexOf("String_Node_Str") + 1,rowCacheP.length()));
      m_schemaDescription.append("String_Node_Str");
      colDefs=fam;
      break;
    }
  }
  if (colDefs == null) {
    throw new Exception("String_Node_Str" + m_columnFamilyName + "String_Node_Str"+ conn.m_keyspaceName+ "String_Node_Str");
  }
  if (m_columnComparator.indexOf("String_Node_Str") > 0) {
    m_columnNameEncoding=UTF8;
  }
 else   if (m_columnComparator.indexOf("String_Node_Str") > 0) {
    m_columnNameEncoding=ASCII;
  }
 else {
    throw new Exception("String_Node_Str");
  }
  m_columnMeta=new TreeMap<String,String>();
  m_indexedVals=new HashMap<String,HashSet<String>>();
  String comment=colDefs.getComment();
  if (comment != null && comment.length() > 0) {
    extractIndexedMeta(comment,m_indexedVals);
  }
  Iterator<ColumnDef> colMetaData=colDefs.getColumn_metadataIterator();
  if (colMetaData != null) {
    while (colMetaData.hasNext()) {
      ColumnDef currentDef=colMetaData.next();
      String colName=new String(currentDef.getName(),Charset.forName(m_columnNameEncoding));
      String colType=currentDef.getValidation_class();
      m_columnMeta.put(colName,colType);
      m_schemaDescription.append("String_Node_Str" + colName);
      m_schemaDescription.append("String_Node_Str" + colType.substring(colType.lastIndexOf("String_Node_Str") + 1,colType.length()));
      String indexName=currentDef.getIndex_name();
      if (!Const.isEmpty(indexName)) {
        m_schemaDescription.append("String_Node_Str" + currentDef.getIndex_name());
      }
      if (m_indexedVals.containsKey(colName)) {
        HashSet<String> indexedVals=m_indexedVals.get(colName);
        m_schemaDescription.append("String_Node_Str");
        int count=0;
        for (        String val : indexedVals) {
          m_schemaDescription.append(val);
          count++;
          if (count != indexedVals.size()) {
            m_schemaDescription.append("String_Node_Str");
          }
 else {
            m_schemaDescription.append("String_Node_Str");
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Refreshes the encapsulated meta data for the column family.
 * @param conn the connection to cassandra to use for refreshing the metadata
 * @throws Exception if a problem occurs during connection or whenfetching meta data
 */
public void refresh(CassandraConnection conn) throws Exception {
  m_schemaDescription=new StringBuffer();
  KsDef keySpace=conn.describeKeyspace();
  List<CfDef> colFams=null;
  if (keySpace != null) {
    colFams=keySpace.getCf_defs();
  }
 else {
    throw new Exception("String_Node_Str" + conn.m_keyspaceName + "String_Node_Str");
  }
  CfDef colDefs=null;
  for (  CfDef fam : colFams) {
    String columnFamilyName=fam.getName();
    if (columnFamilyName.equals(m_columnFamilyName)) {
      m_schemaDescription.append("String_Node_Str" + m_columnFamilyName);
      m_keyValidator=fam.getKey_validation_class();
      m_columnComparator=fam.getComparator_type();
      m_defaultValidationClass=fam.getDefault_validation_class();
      m_schemaDescription.append("String_Node_Str" + m_keyValidator.substring(m_keyValidator.lastIndexOf("String_Node_Str") + 1,m_keyValidator.length()));
      m_schemaDescription.append("String_Node_Str" + m_columnComparator.substring(m_columnComparator.lastIndexOf("String_Node_Str") + 1,m_columnComparator.length()));
      m_schemaDescription.append("String_Node_Str" + m_defaultValidationClass.substring(m_defaultValidationClass.lastIndexOf("String_Node_Str") + 1,m_defaultValidationClass.length()));
      m_schemaDescription.append("String_Node_Str" + fam.getRow_cache_size());
      m_schemaDescription.append("String_Node_Str" + fam.getRow_cache_save_period_in_seconds());
      m_schemaDescription.append("String_Node_Str" + fam.getKey_cache_size());
      m_schemaDescription.append("String_Node_Str" + fam.getKey_cache_save_period_in_seconds());
      m_schemaDescription.append("String_Node_Str" + fam.getRead_repair_chance());
      m_schemaDescription.append("String_Node_Str" + fam.getGc_grace_seconds());
      m_schemaDescription.append("String_Node_Str" + fam.getMin_compaction_threshold());
      m_schemaDescription.append("String_Node_Str" + fam.getMax_compaction_threshold());
      m_schemaDescription.append("String_Node_Str" + fam.replicate_on_write);
      String rowCacheP=fam.getRow_cache_provider();
      m_schemaDescription.append("String_Node_Str" + rowCacheP.substring(rowCacheP.lastIndexOf("String_Node_Str") + 1,rowCacheP.length()));
      m_schemaDescription.append("String_Node_Str");
      colDefs=fam;
      break;
    }
  }
  if (colDefs == null) {
    throw new Exception("String_Node_Str" + m_columnFamilyName + "String_Node_Str"+ conn.m_keyspaceName+ "String_Node_Str");
  }
  if (m_columnComparator.indexOf("String_Node_Str") > 0) {
    m_columnNameEncoding=UTF8;
  }
 else   if (m_columnComparator.indexOf("String_Node_Str") > 0) {
    m_columnNameEncoding=ASCII;
  }
 else {
    throw new Exception("String_Node_Str");
  }
  m_columnMeta=new TreeMap<String,String>();
  m_indexedVals=new HashMap<String,HashSet<Object>>();
  String comment=colDefs.getComment();
  if (comment != null && comment.length() > 0) {
    extractIndexedMeta(comment,m_indexedVals);
  }
  Iterator<ColumnDef> colMetaData=colDefs.getColumn_metadataIterator();
  if (colMetaData != null) {
    while (colMetaData.hasNext()) {
      ColumnDef currentDef=colMetaData.next();
      String colName=new String(currentDef.getName(),Charset.forName(m_columnNameEncoding));
      String colType=currentDef.getValidation_class();
      m_columnMeta.put(colName,colType);
      m_schemaDescription.append("String_Node_Str" + colName);
      m_schemaDescription.append("String_Node_Str" + colType.substring(colType.lastIndexOf("String_Node_Str") + 1,colType.length()));
      String indexName=currentDef.getIndex_name();
      if (!Const.isEmpty(indexName)) {
        m_schemaDescription.append("String_Node_Str" + currentDef.getIndex_name());
      }
      if (m_indexedVals.containsKey(colName)) {
        HashSet<Object> indexedVals=m_indexedVals.get(colName);
        m_schemaDescription.append("String_Node_Str");
        int count=0;
        for (        Object val : indexedVals) {
          m_schemaDescription.append(val.toString());
          count++;
          if (count != indexedVals.size()) {
            m_schemaDescription.append("String_Node_Str");
          }
 else {
            m_schemaDescription.append("String_Node_Str");
          }
        }
      }
    }
  }
}