Program: 176660
Project: 176660
Buggy source:
/** 
 * On compound key.
 * @param tableInfo the table info
 * @throws InvalidRequestException the invalid request exception
 * @throws TException the t exception
 * @throws SchemaDisagreementException the schema disagreement exception
 */
private void onCompoundKey(TableInfo tableInfo) throws InvalidRequestException, TException, SchemaDisagreementException {
  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();
  Properties props=getColumnFamilyProperties(tableInfo);
  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) {
    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);
  cassandra_client.set_cql_version(CassandraConstants.CQL_VERSION_3_0);
  cassandra_client.set_keyspace(databaseName);
  try {
    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" + databaseName + "String_Node_Str",e);
    throw new SchemaGenerationException("String_Node_Str" + databaseName,e,"String_Node_Str",databaseName);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str" + databaseName + "String_Node_Str",e);
    throw new SchemaGenerationException("String_Node_Str" + databaseName,e,"String_Node_Str",databaseName);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str" + databaseName + "String_Node_Str",e);
    throw new SchemaGenerationException("String_Node_Str" + databaseName,e,"String_Node_Str",databaseName);
  }
}

Fixed version (ground truth):
/** 
 * On compound key.
 * @param tableInfo the table info
 * @throws InvalidRequestException the invalid request exception
 * @throws TException the t exception
 * @throws SchemaDisagreementException the schema disagreement exception
 */
private void onCompoundKey(TableInfo tableInfo) throws InvalidRequestException, TException, SchemaDisagreementException {
  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();
  Properties props=getColumnFamilyProperties(tableInfo);
  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);
  cassandra_client.set_cql_version(CassandraConstants.CQL_VERSION_3_0);
  cassandra_client.set_keyspace(databaseName);
  try {
    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" + databaseName + "String_Node_Str",e);
    throw new SchemaGenerationException("String_Node_Str" + databaseName,e,"String_Node_Str",databaseName);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str" + databaseName + "String_Node_Str",e);
    throw new SchemaGenerationException("String_Node_Str" + databaseName,e,"String_Node_Str",databaseName);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str" + databaseName + "String_Node_Str",e);
    throw new SchemaGenerationException("String_Node_Str" + databaseName,e,"String_Node_Str",databaseName);
  }
}