Program: 176020
Project: 176020
Buggy source:
/** 
 * Find inverse join column values for join column.
 * @param schemaName
 * @param tableName
 * @param pKeyColumnName
 * @param columnName
 * @param pKeyColumnValue
 * @param columnJavaType
 * @return
 */
protected <E>List<E> getColumnsByIdUsingCql(String schemaName,String tableName,String pKeyColumnName,String columnName,Object pKeyColumnValue,Class columnJavaType){
  List results=new ArrayList();
  CQLTranslator translator=new CQLTranslator();
  String selectQuery=translator.SELECT_QUERY;
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),tableName,false).toString());
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMNS,translator.ensureCase(new StringBuilder(),columnName,false).toString());
  StringBuilder selectQueryBuilder=new StringBuilder(selectQuery);
  selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  translator.buildWhereClause(selectQueryBuilder,columnJavaType,pKeyColumnName,pKeyColumnValue,CQLTranslator.EQ_CLAUSE,false);
  selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),selectQueryBuilder.length());
  CqlResult cqlResult=execute(selectQueryBuilder.toString(),getRawClient(schemaName));
  Iterator<CqlRow> rowIter=cqlResult.getRows().iterator();
  while (rowIter.hasNext()) {
    CqlRow row=rowIter.next();
    if (!row.getColumns().isEmpty()) {
      Column column=row.getColumns().get(0);
      Object columnValue=PropertyAccessorHelper.getObject(columnJavaType,column.getValue());
      results.add(columnValue);
    }
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Find inverse join column values for join column.
 * @param schemaName
 * @param tableName
 * @param pKeyColumnName
 * @param columnName
 * @param pKeyColumnValue
 * @param columnJavaType
 * @return
 */
protected <E>List<E> getColumnsByIdUsingCql(String schemaName,String tableName,String pKeyColumnName,String columnName,Object pKeyColumnValue,Class columnJavaType){
  List results=new ArrayList();
  CQLTranslator translator=new CQLTranslator();
  String selectQuery=translator.SELECT_QUERY;
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),tableName,false).toString());
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMNS,translator.ensureCase(new StringBuilder(),columnName,false).toString());
  StringBuilder selectQueryBuilder=new StringBuilder(selectQuery);
  selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  translator.buildWhereClause(selectQueryBuilder,columnJavaType,pKeyColumnName,pKeyColumnValue,CQLTranslator.EQ_CLAUSE,false);
  selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),selectQueryBuilder.length());
  CqlResult cqlResult=execute(selectQueryBuilder.toString(),getRawClient(schemaName));
  Iterator<CqlRow> rowIter=cqlResult.getRows().iterator();
  while (rowIter.hasNext()) {
    CqlRow row=rowIter.next();
    if (!row.getColumns().isEmpty()) {
      Column column=row.getColumns().get(0);
      Object columnValue=CassandraDataTranslator.decompose(columnJavaType,column.getValue(),true);
      results.add(columnValue);
    }
  }
  return results;
}