Program: 176862
Project: 176862
Buggy source:
@Override protected void onPersist(EntityMetadata entityMetadata,Object entity,Object id,List<RelationHolder> rlHolders){
  if (!isOpen()) {
    throw new PersistenceException("String_Node_Str");
  }
  if (isUpdate && entityMetadata.isCounterColumnType()) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  ThriftRow tf=null;
  try {
    String columnFamily=entityMetadata.getTableName();
    tf=dataHandler.toThriftRow(entity,id.toString(),entityMetadata,columnFamily);
    timestamp=System.currentTimeMillis();
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e.getMessage());
    throw new KunderaException(e);
  }
  addRelationsToThriftRow(entityMetadata,tf,rlHolders);
  IPooledConnection conn=null;
  try {
    byte[] rowKey=PropertyAccessorHelper.get(entity,entityMetadata.getIdColumn().getField());
    String columnFamily=entityMetadata.getTableName();
    List<Mutation> insertion_list=new ArrayList<Mutation>();
    if (entityMetadata.isCounterColumnType()) {
      List<CounterColumn> thriftCounterColumns=tf.getCounterColumns();
      List<CounterSuperColumn> thriftCounterSuperColumns=tf.getCounterSuperColumns();
      if (thriftCounterColumns != null && !thriftCounterColumns.isEmpty()) {
        for (        CounterColumn column : thriftCounterColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_column(column));
          insertion_list.add(mut);
        }
      }
      if (thriftCounterSuperColumns != null && !thriftCounterSuperColumns.isEmpty()) {
        for (        CounterSuperColumn sc : thriftCounterSuperColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_super_column(sc));
          insertion_list.add(mut);
        }
      }
    }
 else {
      List<Column> thriftColumns=tf.getColumns();
      List<SuperColumn> thriftSuperColumns=tf.getSuperColumns();
      if (thriftColumns != null && !thriftColumns.isEmpty()) {
        for (        Column column : thriftColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column));
          insertion_list.add(mut);
        }
      }
      if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty()) {
        for (        SuperColumn superColumn : thriftSuperColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setSuper_column(superColumn));
          insertion_list.add(mut);
        }
      }
    }
    Map<String,List<Mutation>> columnFamilyValues=new HashMap<String,List<Mutation>>();
    columnFamilyValues.put(columnFamily,insertion_list);
    Map<ByteBuffer,Map<String,List<Mutation>>> mutationMap=new HashMap<ByteBuffer,Map<String,List<Mutation>>>();
    mutationMap.put(ByteBuffer.wrap(rowKey),columnFamilyValues);
    conn=PelopsUtils.getCassandraConnection(entityMetadata.getPersistenceUnit());
    Cassandra.Client cassandra_client=conn.getAPI();
    cassandra_client.set_keyspace(entityMetadata.getSchema());
    cassandra_client.batch_mutate(mutationMap,consistencyLevel);
  }
 catch (  InvalidRequestException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
catch (  TException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
catch (  UnavailableException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
catch (  TimedOutException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
 finally {
    PelopsUtils.releaseConnection(conn);
  }
}

Fixed version (ground truth):
@Override protected void onPersist(EntityMetadata entityMetadata,Object entity,Object id,List<RelationHolder> rlHolders){
  if (!isOpen()) {
    throw new PersistenceException("String_Node_Str");
  }
  if (isUpdate && entityMetadata.isCounterColumnType()) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  ThriftRow tf=null;
  try {
    String columnFamily=entityMetadata.getTableName();
    tf=dataHandler.toThriftRow(entity,id.toString(),entityMetadata,columnFamily);
    timestamp=System.currentTimeMillis();
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + e.getMessage());
    throw new KunderaException(e);
  }
  addRelationsToThriftRow(entityMetadata,tf,rlHolders);
  IPooledConnection conn=null;
  try {
    byte[] rowKey=PropertyAccessorHelper.get(entity,entityMetadata.getIdColumn().getField());
    String columnFamily=entityMetadata.getTableName();
    List<Mutation> insertion_list=new ArrayList<Mutation>();
    if (entityMetadata.isCounterColumnType()) {
      List<CounterColumn> thriftCounterColumns=tf.getCounterColumns();
      List<CounterSuperColumn> thriftCounterSuperColumns=tf.getCounterSuperColumns();
      if (thriftCounterColumns != null && !thriftCounterColumns.isEmpty()) {
        for (        CounterColumn column : thriftCounterColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_column(column));
          insertion_list.add(mut);
        }
      }
      if (thriftCounterSuperColumns != null && !thriftCounterSuperColumns.isEmpty()) {
        for (        CounterSuperColumn sc : thriftCounterSuperColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setCounter_super_column(sc));
          insertion_list.add(mut);
        }
      }
    }
 else {
      List<Column> thriftColumns=tf.getColumns();
      List<SuperColumn> thriftSuperColumns=tf.getSuperColumns();
      if (thriftColumns != null && !thriftColumns.isEmpty()) {
        for (        Column column : thriftColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setColumn(column));
          insertion_list.add(mut);
        }
      }
      if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty()) {
        for (        SuperColumn superColumn : thriftSuperColumns) {
          Mutation mut=new Mutation();
          mut.setColumn_or_supercolumn(new ColumnOrSuperColumn().setSuper_column(superColumn));
          insertion_list.add(mut);
        }
      }
    }
    Map<String,List<Mutation>> columnFamilyValues=new HashMap<String,List<Mutation>>();
    columnFamilyValues.put(columnFamily,insertion_list);
    Map<ByteBuffer,Map<String,List<Mutation>>> mutationMap=new HashMap<ByteBuffer,Map<String,List<Mutation>>>();
    Bytes b=Bytes.fromUTF8(tf.getId());
    mutationMap.put(b.getBytes(),columnFamilyValues);
    conn=PelopsUtils.getCassandraConnection(entityMetadata.getPersistenceUnit());
    Cassandra.Client cassandra_client=conn.getAPI();
    cassandra_client.set_keyspace(entityMetadata.getSchema());
    cassandra_client.batch_mutate(mutationMap,consistencyLevel);
  }
 catch (  InvalidRequestException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
catch (  TException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
catch (  UnavailableException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
catch (  TimedOutException e) {
    log.error(e.getMessage());
    throw new KunderaException(e);
  }
 finally {
    PelopsUtils.releaseConnection(conn);
  }
}