Program: 6537
Project: 6537
Buggy source:
/** 
 * Deletes meta data until a given time, while keeping the latest meta data even if less than tillTime.
 * @param tillTime time till the meta data will be deleted.
 * @param callback callback called before deleting a meta data column.
 * @return total number of columns deleted.
 */
public int cleanMetaData(final long tillTime,final DeleteCallback callback) throws Exception {
  return mds.execute(new TransactionExecutor.Function<DatasetContext<Table>,Integer>(){
    @Override public Integer apply(    DatasetContext<Table> ctx) throws Exception {
      byte[] tillTimeBytes=Bytes.toBytes(tillTime);
      int deletedColumns=0;
      Scanner scanner=ctx.get().scan(ROW_KEY_PREFIX,ROW_KEY_PREFIX_END);
      try {
        Row row;
        while ((row=scanner.next()) != null) {
          byte[] rowKey=row.getRow();
          String namespacedLogDir=LoggingContextHelper.getNamespacedBaseDir(logBaseDir,getLogPartition(rowKey));
          byte[] maxCol=getMaxKey(row.getColumns());
          for (          Map.Entry<byte[],byte[]> entry : row.getColumns().entrySet()) {
            byte[] colName=entry.getKey();
            if (LOG.isDebugEnabled()) {
              LOG.debug("String_Node_Str",Bytes.toString(entry.getValue()),Bytes.toLong(colName));
            }
            if (Bytes.compareTo(colName,tillTimeBytes) < 0 && Bytes.compareTo(colName,maxCol) != 0) {
              callback.handle(locationFactory.create(new URI(Bytes.toString(entry.getValue()))),namespacedLogDir);
              ctx.get().delete(rowKey,colName);
              deletedColumns++;
            }
          }
        }
      }
  finally {
        scanner.close();
      }
      return deletedColumns;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Deletes meta data until a given time, while keeping the latest meta data even if less than tillTime.
 * @param tillTime time till the meta data will be deleted.
 * @param callback callback called before deleting a meta data column.
 * @return total number of columns deleted.
 */
public int cleanMetaData(final long tillTime,final DeleteCallback callback) throws Exception {
  return execute(new TransactionExecutor.Function<Table,Integer>(){
    @Override public Integer apply(    Table table) throws Exception {
      byte[] tillTimeBytes=Bytes.toBytes(tillTime);
      int deletedColumns=0;
      Scanner scanner=table.scan(ROW_KEY_PREFIX,ROW_KEY_PREFIX_END);
      try {
        Row row;
        while ((row=scanner.next()) != null) {
          byte[] rowKey=row.getRow();
          String namespacedLogDir=LoggingContextHelper.getNamespacedBaseDir(logBaseDir,getLogPartition(rowKey));
          byte[] maxCol=getMaxKey(row.getColumns());
          for (          Map.Entry<byte[],byte[]> entry : row.getColumns().entrySet()) {
            byte[] colName=entry.getKey();
            if (LOG.isDebugEnabled()) {
              LOG.debug("String_Node_Str",Bytes.toString(entry.getValue()),Bytes.toLong(colName));
            }
            if (Bytes.compareTo(colName,tillTimeBytes) < 0 && Bytes.compareTo(colName,maxCol) != 0) {
              callback.handle(locationFactory.create(new URI(Bytes.toString(entry.getValue()))),namespacedLogDir);
              table.delete(rowKey,colName);
              deletedColumns++;
            }
          }
        }
      }
  finally {
        scanner.close();
      }
      return deletedColumns;
    }
  }
);
}