Program: 176594
Project: 176594
Buggy source:
/** 
 * Return the generated value of id.
 * @param discriptor
 * @param pu
 * @return
 */
public Long getGeneratedValue(TableGeneratorDiscriptor discriptor,String pu){
  Cassandra.Client conn=getRawClient(pu,discriptor.getSchema());
  try {
    conn.set_keyspace(discriptor.getSchema());
    ColumnPath columnPath=new ColumnPath(discriptor.getTable());
    columnPath.setColumn(discriptor.getValueColumnName().getBytes());
    long latestCount=0l;
    try {
      latestCount=conn.get(ByteBuffer.wrap(discriptor.getPkColumnValue().getBytes()),columnPath,getConsistencyLevel()).counter_column.value;
    }
 catch (    NotFoundException e) {
      latestCount=0;
    }
    ColumnParent columnParent=new ColumnParent(discriptor.getTable());
    CounterColumn counterColumn=new CounterColumn(ByteBuffer.wrap(discriptor.getValueColumnName().getBytes()),1);
    conn.add(ByteBuffer.wrap(discriptor.getPkColumnValue().getBytes()),columnParent,counterColumn,getConsistencyLevel());
    if (latestCount == 0) {
      return (long)discriptor.getInitialValue();
    }
 else {
      return (latestCount + 1) * discriptor.getAllocationSize();
    }
  }
 catch (  InvalidRequestException e) {
    log.error("String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
catch (  TException e) {
    log.error("String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str" + discriptor.getTable() + "String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str" + discriptor.getTable() + "String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
 finally {
    releaseConnection(conn);
  }
}

Fixed version (ground truth):
/** 
 * Return the generated value of id.
 * @param discriptor
 * @param pu
 * @return
 */
public Long getGeneratedValue(TableGeneratorDiscriptor discriptor,String pu){
  Cassandra.Client conn=getRawClient(pu,discriptor.getSchema());
  try {
    conn.set_keyspace(discriptor.getSchema());
    ColumnPath columnPath=new ColumnPath(discriptor.getTable());
    columnPath.setColumn(discriptor.getValueColumnName().getBytes());
    long latestCount=0l;
    try {
      latestCount=conn.get(ByteBuffer.wrap(discriptor.getPkColumnValue().getBytes()),columnPath,getConsistencyLevel()).counter_column.value;
    }
 catch (    NotFoundException e) {
      latestCount=0;
    }
    ColumnParent columnParent=new ColumnParent(discriptor.getTable());
    CounterColumn counterColumn=new CounterColumn(ByteBuffer.wrap(discriptor.getValueColumnName().getBytes()),1);
    conn.add(ByteBuffer.wrap(discriptor.getPkColumnValue().getBytes()),columnParent,counterColumn,getConsistencyLevel());
    if (latestCount == 0) {
      return (long)discriptor.getInitialValue();
    }
 else {
      return (latestCount + 1) * discriptor.getAllocationSize();
    }
  }
 catch (  InvalidRequestException e) {
    log.error("String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
catch (  TException e) {
    log.error("String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
catch (  UnavailableException e) {
    log.error("String_Node_Str" + discriptor.getTable() + "String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
catch (  TimedOutException e) {
    log.error("String_Node_Str" + discriptor.getTable() + "String_Node_Str",e);
    throw new KunderaException("String_Node_Str",e);
  }
}