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

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