Program: 176802
Project: 176802
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("String_Node_Str");
  try {
    cassandra_client.execute_cql_query(ByteBuffer.wrap(queryBuilder.toString().getBytes(Constants.CHARSET_UTF8)),Compression.NONE);
  }
 catch (  UnsupportedEncodingException e) {
    log.error("String_Node_Str" + databaseName + "String_Node_Str"+ e.getMessage());
    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.getMessage());
    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.getMessage());
    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) {
    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(CassandraPropertyReader.csmd != null ? CassandraPropertyReader.csmd.getCqlVersion() : CassandraConstants.CQL_VERSION_3_0);
  try {
    cassandra_client.execute_cql_query(ByteBuffer.wrap(queryBuilder.toString().getBytes(Constants.CHARSET_UTF8)),Compression.NONE);
  }
 catch (  UnsupportedEncodingException e) {
    log.error("String_Node_Str" + databaseName + "String_Node_Str"+ e.getMessage());
    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.getMessage());
    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.getMessage());
    throw new SchemaGenerationException("String_Node_Str" + databaseName,e,"String_Node_Str",databaseName);
  }
}