Program: 176695
Project: 176695
Buggy source:
@Override protected void onPersist(EntityMetadata metadata,Object entity,Object id,List<RelationHolder> rlHolders){
  if (!isOpen()) {
    throw new PersistenceException("String_Node_Str");
  }
  if (isUpdate && metadata.isCounterColumnType()) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
  if (metaModel.isEmbeddable(metadata.getIdAttribute().getBindableJavaType())) {
    Cassandra.Client client=getRawClient(metadata.getPersistenceUnit(),metadata.getSchema());
    try {
      client.set_cql_version(getCqlVersion());
      client.set_keyspace(metadata.getSchema());
      onpersistOverCompositeKey(metadata,entity,client);
    }
 catch (    InvalidRequestException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    TException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    UnsupportedEncodingException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    UnavailableException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    TimedOutException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    SchemaDisagreementException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
  }
 else {
    ThriftRow tf=null;
    try {
      String columnFamily=metadata.getTableName();
      tf=dataHandler.toThriftRow(entity,id,metadata,columnFamily);
      timestamp=System.currentTimeMillis();
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
    addRelationsToThriftRow(metadata,tf,rlHolders);
    Mutator mutator=Pelops.createMutator(PelopsUtils.generatePoolName(getPersistenceUnit(),externalProperties));
    if (metadata.isCounterColumnType()) {
      List<CounterColumn> thriftCounterColumns=tf.getCounterColumns();
      List<CounterSuperColumn> thriftCounterSuperColumns=tf.getCounterSuperColumns();
      if (thriftCounterColumns != null && !thriftCounterColumns.isEmpty()) {
        mutator.writeCounterColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Arrays.asList(tf.getCounterColumns().toArray(new CounterColumn[0])));
      }
      if (thriftCounterSuperColumns != null && !thriftCounterSuperColumns.isEmpty()) {
        for (        CounterSuperColumn sc : thriftCounterSuperColumns) {
          mutator.writeSubCounterColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Bytes.fromByteArray(sc.getName()),sc.getColumns());
        }
      }
    }
 else {
      List<Column> thriftColumns=tf.getColumns();
      List<SuperColumn> thriftSuperColumns=tf.getSuperColumns();
      if (thriftColumns != null && !thriftColumns.isEmpty()) {
        mutator.writeColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Arrays.asList(tf.getColumns().toArray(new Column[0])));
      }
      if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty()) {
        for (        SuperColumn sc : thriftSuperColumns) {
          mutator.writeSubColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Bytes.fromByteArray(sc.getName()),sc.getColumns());
        }
      }
    }
    mutator.execute(getConsistencyLevel());
    tf=null;
  }
}

Fixed version (ground truth):
@Override protected void onPersist(EntityMetadata metadata,Object entity,Object id,List<RelationHolder> rlHolders){
  if (!isOpen()) {
    throw new PersistenceException("String_Node_Str");
  }
  if (isUpdate && metadata.isCounterColumnType()) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
  if (metaModel.isEmbeddable(metadata.getIdAttribute().getBindableJavaType())) {
    Cassandra.Client client=getRawClient(metadata.getPersistenceUnit(),metadata.getSchema());
    try {
      client.set_cql_version(getCqlVersion());
      client.set_keyspace(metadata.getSchema());
      onpersistOverCompositeKey(metadata,entity,client,rlHolders);
    }
 catch (    InvalidRequestException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    TException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    UnsupportedEncodingException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    UnavailableException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    TimedOutException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
catch (    SchemaDisagreementException e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
  }
 else {
    ThriftRow tf=null;
    try {
      String columnFamily=metadata.getTableName();
      tf=dataHandler.toThriftRow(entity,id,metadata,columnFamily);
      timestamp=System.currentTimeMillis();
    }
 catch (    Exception e) {
      log.error("String_Node_Str" + e.getMessage());
      throw new KunderaException(e);
    }
    addRelationsToThriftRow(metadata,tf,rlHolders);
    Mutator mutator=Pelops.createMutator(PelopsUtils.generatePoolName(getPersistenceUnit(),externalProperties));
    if (metadata.isCounterColumnType()) {
      List<CounterColumn> thriftCounterColumns=tf.getCounterColumns();
      List<CounterSuperColumn> thriftCounterSuperColumns=tf.getCounterSuperColumns();
      if (thriftCounterColumns != null && !thriftCounterColumns.isEmpty()) {
        mutator.writeCounterColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Arrays.asList(tf.getCounterColumns().toArray(new CounterColumn[0])));
      }
      if (thriftCounterSuperColumns != null && !thriftCounterSuperColumns.isEmpty()) {
        for (        CounterSuperColumn sc : thriftCounterSuperColumns) {
          mutator.writeSubCounterColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Bytes.fromByteArray(sc.getName()),sc.getColumns());
        }
      }
    }
 else {
      List<Column> thriftColumns=tf.getColumns();
      List<SuperColumn> thriftSuperColumns=tf.getSuperColumns();
      if (thriftColumns != null && !thriftColumns.isEmpty()) {
        mutator.writeColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Arrays.asList(tf.getColumns().toArray(new Column[0])));
      }
      if (thriftSuperColumns != null && !thriftSuperColumns.isEmpty()) {
        for (        SuperColumn sc : thriftSuperColumns) {
          mutator.writeSubColumns(metadata.getTableName(),CassandraUtilities.toBytes(tf.getId(),tf.getId().getClass()),Bytes.fromByteArray(sc.getName()),sc.getColumns());
        }
      }
    }
    mutator.execute(getConsistencyLevel());
    tf=null;
  }
}