Program: 176015
Project: 176015
Buggy source:
/** 
 * Persists a Join table record set into database
 */
@Override public void persistJoinTable(JoinTableData joinTableData){
  String joinTableName=joinTableData.getJoinTableName();
  String invJoinColumnName=joinTableData.getInverseJoinColumnName();
  Map<Object,Set<Object>> joinTableRecords=joinTableData.getJoinTableRecords();
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(kunderaMetadata,joinTableData.getEntityClass());
  Connection conn=null;
  try {
    conn=getConnection();
    if (isCql3Enabled(entityMetadata)) {
      persistJoinTableByCql(joinTableData,conn.getClient());
    }
 else {
      for (      Object key : joinTableRecords.keySet()) {
        PropertyAccessor accessor=PropertyAccessorFactory.getPropertyAccessor((Field)entityMetadata.getIdAttribute().getJavaMember());
        byte[] rowKey=accessor.toBytes(key);
        Set<Object> values=joinTableRecords.get(key);
        List<Column> columns=new ArrayList<Column>();
        List<Mutation> insertionList=new ArrayList<Mutation>();
        Class columnType=null;
        for (        Object value : values) {
          Column column=new Column();
          column.setName(PropertyAccessorFactory.STRING.toBytes(invJoinColumnName + Constants.JOIN_COLUMN_NAME_SEPARATOR + value));
          column.setValue(PropertyAccessorHelper.getBytes(value));
          column.setTimestamp(System.currentTimeMillis());
          columnType=value.getClass();
          columns.add(column);
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column));
          insertionList.add(mut);
        }
        createIndexesOnColumns(entityMetadata,joinTableName,columns,columnType);
        Map<String,List<Mutation>> columnFamilyValues=new HashMap<String,List<Mutation>>();
        columnFamilyValues.put(joinTableName,insertionList);
        Map<ByteBuffer,Map<String,List<Mutation>>> mulationMap=new HashMap<ByteBuffer,Map<String,List<Mutation>>>();
        mulationMap.put(ByteBuffer.wrap(rowKey),columnFamilyValues);
        conn.getClient().set_keyspace(entityMetadata.getSchema());
        conn.getClient().batch_mutate(mulationMap,getConsistencyLevel());
      }
    }
  }
 catch (  InvalidRequestException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  TException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
 finally {
    releaseConnection(conn);
  }
}

Fixed version (ground truth):
/** 
 * Persists a Join table record set into database
 */
@Override public void persistJoinTable(JoinTableData joinTableData){
  String joinTableName=joinTableData.getJoinTableName();
  String invJoinColumnName=joinTableData.getInverseJoinColumnName();
  Map<Object,Set<Object>> joinTableRecords=joinTableData.getJoinTableRecords();
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(kunderaMetadata,joinTableData.getEntityClass());
  Connection conn=null;
  try {
    conn=getConnection();
    if (isCql3Enabled(entityMetadata)) {
      persistJoinTableByCql(joinTableData,conn.getClient());
    }
 else {
      for (      Object key : joinTableRecords.keySet()) {
        PropertyAccessor accessor=PropertyAccessorFactory.getPropertyAccessor((Field)entityMetadata.getIdAttribute().getJavaMember());
        byte[] rowKey=accessor.toBytes(key);
        Set<Object> values=joinTableRecords.get(key);
        List<Column> columns=new ArrayList<Column>();
        List<Mutation> insertionList=new ArrayList<Mutation>();
        Class columnType=null;
        for (        Object value : values) {
          Column column=new Column();
          column.setName(PropertyAccessorFactory.STRING.toBytes(invJoinColumnName + Constants.JOIN_COLUMN_NAME_SEPARATOR + value));
          column.setValue(PropertyAccessorHelper.getBytes(value));
          column.setTimestamp(System.currentTimeMillis());
          columnType=value.getClass();
          columns.add(column);
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column));
          insertionList.add(mut);
        }
        createIndexesOnColumns(entityMetadata,joinTableName,columns,columnType);
        Map<String,List<Mutation>> columnFamilyValues=new HashMap<String,List<Mutation>>();
        columnFamilyValues.put(joinTableName,insertionList);
        Map<ByteBuffer,Map<String,List<Mutation>>> mulationMap=new HashMap<ByteBuffer,Map<String,List<Mutation>>>();
        mulationMap.put(ByteBuffer.wrap(rowKey),columnFamilyValues);
        conn.getClient().set_keyspace(entityMetadata.getSchema());
        conn.getClient().batch_mutate(mulationMap,getConsistencyLevel());
      }
    }
  }
 catch (  InvalidRequestException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
catch (  TException e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
 finally {
    releaseConnection(conn);
  }
}