Program: 176485
Project: 176485
Buggy source:
/** 
 * On compound key.
 * @param tableInfo the table infos
 * @throws TimedOutException
 * @throws UnavailableException
 * @throws InvalidRequestException the invalid request exception
 * @throws TException the t exception
 * @throws SchemaDisagreementException the schema disagreement exception
 */
private void onCompoundKey(TableInfo tableInfo){
  CQLTranslator translator=new CQLTranslator();
  String columnFamilyQuery=CQLTranslator.CREATE_COLUMNFAMILY_QUERY;
  columnFamilyQuery=StringUtils.replace(columnFamilyQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),tableInfo.getTableName()).toString());
  List<ColumnInfo> columns=tableInfo.getColumnMetadatas();
  StringBuilder queryBuilder=new StringBuilder();
  onCompositeColumns(translator,columns,queryBuilder);
  List<EmbeddedColumnInfo> compositeColumns=tableInfo.getEmbeddedColumnMetadatas();
  EmbeddableType compoEmbeddableType=compositeColumns.get(0).getEmbeddable();
  onCompositeColumns(translator,compositeColumns.get(0).getColumns(),queryBuilder);
  if (queryBuilder.length() > 0) {
    queryBuilder.deleteCharAt(queryBuilder.length() - 1);
    columnFamilyQuery=StringUtils.replace(columnFamilyQuery,CQLTranslator.COLUMNS,queryBuilder.toString());
    queryBuilder=new StringBuilder(columnFamilyQuery);
  }
  queryBuilder.append(translator.ADD_PRIMARYKEY_CLAUSE);
  Field[] fields=tableInfo.getTableIdType().getDeclaredFields();
  StringBuilder primaryKeyBuilder=new StringBuilder();
  for (  Field f : fields) {
    if (!ReflectUtils.isTransientOrStatic(f)) {
      Attribute attribute=compoEmbeddableType.getAttribute(f.getName());
      translator.appendColumnName(primaryKeyBuilder,((AbstractAttribute)attribute).getJPAColumnName());
      primaryKeyBuilder.append("String_Node_Str");
    }
  }
  primaryKeyBuilder.deleteCharAt(primaryKeyBuilder.length() - 1);
  queryBuilder=new StringBuilder(StringUtils.replace(queryBuilder.toString(),CQLTranslator.COLUMNS,primaryKeyBuilder.toString()));
  setColumnFamilyProperties(null,getColumnFamilyProperties(tableInfo),queryBuilder);
  try {
    cassandra_client.set_cql_version(CassandraConstants.CQL_VERSION_3_0);
    cassandra_client.set_keyspace(databaseName);
    cassandra_client.execute_cql3_query(ByteBuffer.wrap(queryBuilder.toString().getBytes(Constants.CHARSET_UTF8)),Compression.NONE,ConsistencyLevel.ONE);
  }
 catch (  UnsupportedEncodingException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException(e);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException(e);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException(e);
  }
catch (  InvalidRequestException ire) {
    StringBuilder builder=new StringBuilder("String_Node_Str");
    if (ire.getWhy() != null && ire.getWhy().contains(builder.toString()) && operation.equalsIgnoreCase(ScheamOperationType.update.name())) {
      for (      ColumnInfo column : tableInfo.getColumnMetadatas()) {
        addColumnToTable(tableInfo,translator,column);
      }
    }
 else     if (ire.getWhy() != null && ire.getWhy().equals(builder.toString())) {
      dropTableUsingCQL(tableInfo);
      onCompoundKey(tableInfo);
    }
 else {
      log.error("String_Node_Str",tableInfo.getTableName(),ire);
      throw new SchemaGenerationException("String_Node_Str" + tableInfo.getTableName(),ire,"String_Node_Str",databaseName);
    }
  }
catch (  SchemaDisagreementException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException("String_Node_Str" + tableInfo.getTableName(),e,"String_Node_Str",databaseName);
  }
catch (  TException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException("String_Node_Str" + tableInfo.getTableName(),e,"String_Node_Str",databaseName);
  }
}

Fixed version (ground truth):
/** 
 * On compound key.
 * @param tableInfo the table infos
 * @throws TimedOutException
 * @throws UnavailableException
 * @throws InvalidRequestException the invalid request exception
 * @throws TException the t exception
 * @throws SchemaDisagreementException the schema disagreement exception
 */
private void onCompoundKey(TableInfo tableInfo){
  CQLTranslator translator=new CQLTranslator();
  String columnFamilyQuery=CQLTranslator.CREATE_COLUMNFAMILY_QUERY;
  columnFamilyQuery=StringUtils.replace(columnFamilyQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),tableInfo.getTableName()).toString());
  List<ColumnInfo> columns=tableInfo.getColumnMetadatas();
  StringBuilder queryBuilder=new StringBuilder();
  onCompositeColumns(translator,columns,queryBuilder,null);
  List<EmbeddedColumnInfo> compositeColumns=tableInfo.getEmbeddedColumnMetadatas();
  EmbeddableType compoEmbeddableType=compositeColumns.get(0).getEmbeddable();
  onCompositeColumns(translator,compositeColumns.get(0).getColumns(),queryBuilder,columns);
  if (queryBuilder.length() > 0) {
    queryBuilder.deleteCharAt(queryBuilder.length() - 1);
    columnFamilyQuery=StringUtils.replace(columnFamilyQuery,CQLTranslator.COLUMNS,queryBuilder.toString());
    queryBuilder=new StringBuilder(columnFamilyQuery);
  }
  queryBuilder.append(translator.ADD_PRIMARYKEY_CLAUSE);
  Field[] fields=tableInfo.getTableIdType().getDeclaredFields();
  StringBuilder primaryKeyBuilder=new StringBuilder();
  for (  Field f : fields) {
    if (!ReflectUtils.isTransientOrStatic(f)) {
      Attribute attribute=compoEmbeddableType.getAttribute(f.getName());
      translator.appendColumnName(primaryKeyBuilder,((AbstractAttribute)attribute).getJPAColumnName());
      primaryKeyBuilder.append("String_Node_Str");
    }
  }
  primaryKeyBuilder.deleteCharAt(primaryKeyBuilder.length() - 1);
  queryBuilder=new StringBuilder(StringUtils.replace(queryBuilder.toString(),CQLTranslator.COLUMNS,primaryKeyBuilder.toString()));
  setColumnFamilyProperties(null,getColumnFamilyProperties(tableInfo),queryBuilder);
  try {
    cassandra_client.set_cql_version(CassandraConstants.CQL_VERSION_3_0);
    cassandra_client.set_keyspace(databaseName);
    cassandra_client.execute_cql3_query(ByteBuffer.wrap(queryBuilder.toString().getBytes(Constants.CHARSET_UTF8)),Compression.NONE,ConsistencyLevel.ONE);
  }
 catch (  UnsupportedEncodingException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException(e);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException(e);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException(e);
  }
catch (  InvalidRequestException ire) {
    StringBuilder builder=new StringBuilder("String_Node_Str");
    if (ire.getWhy() != null && ire.getWhy().contains(builder.toString()) && operation.equalsIgnoreCase(ScheamOperationType.update.name())) {
      for (      ColumnInfo column : tableInfo.getColumnMetadatas()) {
        addColumnToTable(tableInfo,translator,column);
      }
    }
 else     if (ire.getWhy() != null && ire.getWhy().equals(builder.toString())) {
      dropTableUsingCQL(tableInfo);
      onCompoundKey(tableInfo);
    }
 else {
      log.error("String_Node_Str",tableInfo.getTableName(),ire);
      throw new SchemaGenerationException("String_Node_Str" + tableInfo.getTableName(),ire,"String_Node_Str",databaseName);
    }
  }
catch (  SchemaDisagreementException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException("String_Node_Str" + tableInfo.getTableName(),e,"String_Node_Str",databaseName);
  }
catch (  TException e) {
    log.error("String_Node_Str",tableInfo.getTableName(),e);
    throw new SchemaGenerationException("String_Node_Str" + tableInfo.getTableName(),e,"String_Node_Str",databaseName);
  }
}