nus-yam/ex-repair huggingface dataset:
Program: 108416
Project: 108416
Buggy source:
@Override public boolean doCommand(ILayerCommand command){
  if (command instanceof FillLayerResetCommand) {
    this.modified=false;
    if (isEqualWidthActive()) {
      this.ignore=true;
      for (int i=0; i < getColumnCount(); i++) {
        ColumnResizeCommand resize=new ColumnResizeCommand(this,i,DataLayer.DEFAULT_COLUMN_WIDTH);
        underlyingLayer.doCommand(resize);
      }
      this.ignore=false;
    }
  }
  return super.doCommand(command);
}

Fixed version (ground truth):
@Override public boolean doCommand(ILayerCommand command){
  if (command instanceof FillLayerResetCommand) {
    this.modified=false;
    this.ignore=true;
    for (int i=0; i < getColumnCount(); i++) {
      ColumnResizeCommand resize=new ColumnResizeCommand(this,i,DataLayer.DEFAULT_COLUMN_WIDTH);
      underlyingLayer.doCommand(resize);
    }
    this.ignore=false;
  }
  return super.doCommand(command);
}
Program: 108417
Project: 108417
Buggy source:
private int getGapWidth(){
  NatTable table=getContext().getTable();
  return table != null ? table.getSize().x - super.getWidth() : 0;
}

Fixed version (ground truth):
private int getGapWidth(){
  NatTable table=getContext().getTable();
  if (table.isDisposed())   return 0;
  return table != null ? table.getSize().x - super.getWidth() : 0;
}
Program: 108418
Project: 108418
Buggy source:
private int getEqualWidth(){
  int offset=underlyingLayer.getClientAreaProvider().getClientArea().x;
  int width=getContext().getTable().getSize().x - offset;
  if (underlyingLayer.getColumnCount() == 0) {
    return width;
  }
  return width / underlyingLayer.getColumnCount();
}

Fixed version (ground truth):
private int getEqualWidth(){
  NatTable table=getContext().getTable();
  if (table.isDisposed())   return 0;
  int offset=underlyingLayer.getClientAreaProvider().getClientArea().x;
  int width=table.getSize().x - offset;
  if (underlyingLayer.getColumnCount() == 0) {
    return width;
  }
  return width / underlyingLayer.getColumnCount();
}
Program: 108419
Project: 108419
Buggy source:
private int getGapHeight(){
  NatTable table=getContext().getTable();
  return table != null ? table.getSize().y - DataLayer.DEFAULT_ROW_HEIGHT - super.getHeight() : 0;
}

Fixed version (ground truth):
private int getGapHeight(){
  NatTable table=getContext().getTable();
  if (table.isDisposed())   return 0;
  return table != null ? table.getSize().y - DataLayer.DEFAULT_ROW_HEIGHT - super.getHeight() : 0;
}
Program: 108420
Project: 108420
Buggy source:
private void checkScrollBars(){
  Listener[] listeners=context.getTable().getListeners(SWT.Resize);
  for (  Listener listener : listeners) {
    context.getTable().removeListener(SWT.Resize,listener);
  }
  if (context.isColumnExpanded()) {
    context.getTable().getHorizontalBar().setVisible(false);
  }
  if (context.isRowExpanded()) {
    context.getTable().getVerticalBar().setVisible(false);
  }
  for (  Listener listener : listeners) {
    context.getTable().addListener(SWT.Resize,listener);
  }
}

Fixed version (ground truth):
private void checkScrollBars(){
  if (context.getTable().isDisposed()) {
    return;
  }
  Listener[] listeners=context.getTable().getListeners(SWT.Resize);
  for (  Listener listener : listeners) {
    context.getTable().removeListener(SWT.Resize,listener);
  }
  if (context.isColumnExpanded()) {
    context.getTable().getHorizontalBar().setVisible(false);
  }
  if (context.isRowExpanded()) {
    context.getTable().getVerticalBar().setVisible(false);
  }
  for (  Listener listener : listeners) {
    context.getTable().addListener(SWT.Resize,listener);
  }
}
Program: 108421
Project: 108421
Buggy source:
/** 
 * Action
 * @param arg0
 */
private void actionColumnSelected(ColumnSelectionEvent arg0){
  this.selectedColumn=null;
  this.selectedRow=null;
  int column=arg0.getColumnPositionRanges().iterator().next().start;
  if (column >= 0) {
    this.selectedColumn=column;
    fireSelectionEvent();
  }
}

Fixed version (ground truth):
/** 
 * Action
 * @param arg0
 */
private boolean actionColumnSelected(ColumnSelectionEvent arg0){
  this.selectedColumn=null;
  this.selectedRow=null;
  int column=arg0.getColumnPositionRanges().iterator().next().start;
  if (column >= 0 && column < dataProviderBody.getColumnCount()) {
    this.selectedColumn=column;
    fireSelectionEvent();
    return true;
  }
 else {
    return false;
  }
}
Program: 108422
Project: 108422
Buggy source:
@Override public void handleLayerEvent(ILayerEvent arg0){
  if (arg0 instanceof CellSelectionEvent) {
    actionCellSelected((CellSelectionEvent)arg0);
  }
 else   if (arg0 instanceof ColumnSelectionEvent) {
    actionColumnSelected((ColumnSelectionEvent)arg0);
  }
 else   if (arg0 instanceof RowSelectionEvent) {
    actionRowSelected((RowSelectionEvent)arg0);
  }
}

Fixed version (ground truth):
@Override public void handleLayerEvent(ILayerEvent arg0){
  if (arg0 instanceof CellSelectionEvent) {
    if (!actionCellSelected((CellSelectionEvent)arg0)) {
      layer.clear(true);
    }
  }
 else   if (arg0 instanceof ColumnSelectionEvent) {
    if (!actionColumnSelected((ColumnSelectionEvent)arg0)) {
      layer.clear(true);
    }
  }
 else   if (arg0 instanceof RowSelectionEvent) {
    if (!actionRowSelected((RowSelectionEvent)arg0)) {
      layer.clear(true);
    }
  }
}
Program: 108423
Project: 108423
Buggy source:
/** 
 * Action
 * @param arg0
 */
private void actionCellSelected(CellSelectionEvent arg0){
  this.selectedColumn=null;
  this.selectedRow=null;
  int column=arg0.getColumnPosition();
  int row=arg0.getRowPosition();
  if (column >= 0 && row >= 0) {
    this.selectedColumn=column;
    this.selectedRow=row;
    fireSelectionEvent();
  }
}

Fixed version (ground truth):
/** 
 * Action
 * @param arg0
 */
private boolean actionCellSelected(CellSelectionEvent arg0){
  this.selectedColumn=null;
  this.selectedRow=null;
  int column=arg0.getColumnPosition();
  int row=arg0.getRowPosition();
  if (column >= 0 && row >= 0 && row < dataProviderBody.getRowCount() && column < dataProviderBody.getColumnCount()) {
    this.selectedColumn=column;
    this.selectedRow=row;
    fireSelectionEvent();
    return true;
  }
 else {
    return false;
  }
}
Program: 108424
Project: 108424
Buggy source:
/** 
 * Adds a selection listener
 * @param layer
 */
private void addSelectionListener(SelectionLayer layer){
  layer.addLayerListener(new ILayerListener(){
    @Override public void handleLayerEvent(    ILayerEvent arg0){
      if (arg0 instanceof CellSelectionEvent) {
        actionCellSelected((CellSelectionEvent)arg0);
      }
 else       if (arg0 instanceof ColumnSelectionEvent) {
        actionColumnSelected((ColumnSelectionEvent)arg0);
      }
 else       if (arg0 instanceof RowSelectionEvent) {
        actionRowSelected((RowSelectionEvent)arg0);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Adds a selection listener
 * @param layer
 */
private void addSelectionListener(final SelectionLayer layer){
  layer.addLayerListener(new ILayerListener(){
    @Override public void handleLayerEvent(    ILayerEvent arg0){
      if (arg0 instanceof CellSelectionEvent) {
        if (!actionCellSelected((CellSelectionEvent)arg0)) {
          layer.clear(true);
        }
      }
 else       if (arg0 instanceof ColumnSelectionEvent) {
        if (!actionColumnSelected((ColumnSelectionEvent)arg0)) {
          layer.clear(true);
        }
      }
 else       if (arg0 instanceof RowSelectionEvent) {
        if (!actionRowSelected((RowSelectionEvent)arg0)) {
          layer.clear(true);
        }
      }
    }
  }
);
}
Program: 108425
Project: 108425
Buggy source:
/** 
 * Action
 * @param arg0
 */
private void actionRowSelected(RowSelectionEvent arg0){
  this.selectedColumn=null;
  this.selectedRow=null;
  int row=arg0.getRowPositionRanges().iterator().next().start;
  if (row >= 0) {
    this.selectedRow=row;
    fireSelectionEvent();
  }
}

Fixed version (ground truth):
/** 
 * Action
 * @param arg0
 */
private boolean actionRowSelected(RowSelectionEvent arg0){
  this.selectedColumn=null;
  this.selectedRow=null;
  int row=arg0.getRowPositionRanges().iterator().next().start;
  if (row >= 0 && row < dataProviderBody.getRowCount()) {
    this.selectedRow=row;
    fireSelectionEvent();
    return true;
  }
 else {
    return false;
  }
}
Program: 108426
Project: 108426
Buggy source:
/** 
 * This method is called when the metric may clear its cache.
 */
public void freeCache(){
  cache.clear();
}

Fixed version (ground truth):
/** 
 * This method is called when the metric may clear its cache.
 */
public void freeCache(){
  if (cache != null)   cache.clear();
}
Program: 108427
Project: 108427
Buggy source:
/** 
 * Returns a cache that may be used for arbitrary things
 * @param node
 * @return
 */
protected Map<Node,T> getCache(){
  return this.cache;
}

Fixed version (ground truth):
/** 
 * Returns a cache that may be used for arbitrary things
 * @param node
 * @return
 */
protected Map<Node,T> getCache(){
  if (cache == null) {
    cache=new HashMap<Node,T>();
  }
  return this.cache;
}
Program: 108428
Project: 108428
Buggy source:
/** 
 * Removes all items
 */
private void removeAllItems(){
  table.setRedraw(false);
  for (  final TableItem i : table.getItems()) {
    i.dispose();
  }
  table.removeAll();
  table.setRedraw(true);
  table.redraw();
}

Fixed version (ground truth):
/** 
 * Removes all items
 */
private void removeAllItems(){
  for (  final TableItem i : table.getItems()) {
    i.dispose();
  }
  table.removeAll();
}
Program: 108435
Project: 108435
Buggy source:
/** 
 * Updates the combos
 */
private void updateCombos(){
  if (model == null || min == null) {
    return;
  }
  final List<String> minItems=new ArrayList<String>();
  final List<String> maxItems=new ArrayList<String>();
  minItems.add(ITEM_ALL);
  for (int i=1; i <= (hierarchy == null ? 0 : hierarchy[0].length); i++) {
    minItems.add(String.valueOf(i));
    maxItems.add(String.valueOf(i));
  }
  maxItems.add(ITEM_ALL);
  Integer minModel=model.getInputConfig().getMinimumGeneralization(attribute);
  String minSelected=ITEM_ALL;
  if (minModel != null)   minSelected=String.valueOf(minModel + 1);
  int minIndex=minIndexOf(minSelected);
  Integer maxModel=model.getInputConfig().getMaximumGeneralization(attribute);
  String maxSelected=ITEM_ALL;
  if (maxModel != null)   maxSelected=String.valueOf(maxModel + 1);
  int maxIndex=maxIndexOf(maxSelected);
  if (minIndex > (maxIndex + 1)) {
    minIndex=maxIndex + 1;
  }
  min.setItems(minItems.toArray(new String[]{}));
  max.setItems(maxItems.toArray(new String[]{}));
  min.select(minIndex);
  max.select(maxIndex);
  pushMin();
  pushMax();
}

Fixed version (ground truth):
/** 
 * Updates the combos
 */
private void updateCombos(){
  if (model == null || min == null || min.isDisposed()) {
    return;
  }
  final List<String> minItems=new ArrayList<String>();
  final List<String> maxItems=new ArrayList<String>();
  minItems.add(ITEM_ALL);
  for (int i=1; i <= (hierarchy == null ? 0 : hierarchy[0].length); i++) {
    minItems.add(String.valueOf(i));
    maxItems.add(String.valueOf(i));
  }
  maxItems.add(ITEM_ALL);
  Integer minModel=model.getInputConfig().getMinimumGeneralization(attribute);
  String minSelected=ITEM_ALL;
  if (minModel != null)   minSelected=String.valueOf(minModel + 1);
  int minIndex=minIndexOf(minSelected);
  Integer maxModel=model.getInputConfig().getMaximumGeneralization(attribute);
  String maxSelected=ITEM_ALL;
  if (maxModel != null)   maxSelected=String.valueOf(maxModel + 1);
  int maxIndex=maxIndexOf(maxSelected);
  if (minIndex > (maxIndex + 1)) {
    minIndex=maxIndex + 1;
  }
  min.setItems(minItems.toArray(new String[]{}));
  max.setItems(maxItems.toArray(new String[]{}));
  min.select(minIndex);
  max.select(maxIndex);
  pushMin();
  pushMax();
}
Program: 108436
Project: 108436
Buggy source:
/** 
 * Resets the view
 */
@Override public void reset(){
  this.numNodes=0;
  this.optimum=null;
  this.selectedNode=null;
  for (  ARXNode node : lattice) {
    Path path=(Path)node.getAttributes().get(ATTRIBUTE_PATH);
    if (path != null)     path.dispose();
  }
  this.lattice.clear();
  this.latticeWidth=0;
  this.latticeHeight=0;
  this.screen=null;
  this.canvas.redraw();
}

Fixed version (ground truth):
/** 
 * Resets the view
 */
@Override public void reset(){
  this.numNodes=0;
  this.optimum=null;
  this.selectedNode=null;
  for (  ARXNode node : lattice) {
    Path path=(Path)node.getAttributes().get(ATTRIBUTE_PATH);
    if (path != null) {
      node.getAttributes().put(ATTRIBUTE_PATH,null);
      path.dispose();
    }
  }
  this.lattice.clear();
  this.latticeWidth=0;
  this.latticeHeight=0;
  this.screen=null;
  this.canvas.redraw();
}
Program: 108438
Project: 108438
Buggy source:
/** 
 * Moves an element up
 */
private void actionMoveUp(){
  if (null == targetRow) {
    return;
  }
  final int index=table.indexOf(targetRow);
  if (index <= 0) {
    return;
  }
  table.setRedraw(false);
  final TableItem o1=table.getItems()[index - 1];
  final TableItem o2=table.getItems()[index];
  final TableItem n1=new TableItem(table,SWT.NONE,index);
  n1.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n1.setText(i,o1.getText(i));
  }
  final TableItem n2=new TableItem(table,SWT.NONE,index);
  n2.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n2.setText(i,o2.getText(i));
  }
  o1.dispose();
  o2.dispose();
  base.setRedraw(true);
  base.redraw();
  targetRow=null;
  updateArray();
  updateCombos();
  pushHierarchy();
  pushMin();
  pushMax();
}

Fixed version (ground truth):
/** 
 * Moves an element up
 */
private void actionMoveUp(){
  if (null == targetRow) {
    return;
  }
  final int index=table.indexOf(targetRow);
  if (index <= 0) {
    return;
  }
  base.setRedraw(false);
  final TableItem o1=table.getItems()[index - 1];
  final TableItem o2=table.getItems()[index];
  final TableItem n1=new TableItem(table,SWT.NONE,index);
  n1.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n1.setText(i,o1.getText(i));
  }
  final TableItem n2=new TableItem(table,SWT.NONE,index);
  n2.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n2.setText(i,o2.getText(i));
  }
  o1.dispose();
  o2.dispose();
  base.setRedraw(true);
  base.redraw();
  targetRow=null;
  updateArray();
  updateCombos();
  pushHierarchy();
  pushMin();
  pushMax();
}
Program: 108439
Project: 108439
Buggy source:
/** 
 * Moves an element down
 */
private void actionMoveDown(){
  if (null == targetRow) {
    return;
  }
  int index=table.indexOf(targetRow);
  if (index >= (table.getItemCount() - 1)) {
    return;
  }
  table.setRedraw(false);
  TableItem o1=table.getItems()[index];
  TableItem o2=table.getItems()[index + 1];
  TableItem n1=new TableItem(table,SWT.NONE,index);
  n1.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n1.setText(i,o1.getText(i));
  }
  TableItem n2=new TableItem(table,SWT.NONE,index);
  n2.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n2.setText(i,o2.getText(i));
  }
  o1.dispose();
  o2.dispose();
  base.setRedraw(true);
  base.redraw();
  targetRow=null;
  updateArray();
  updateCombos();
  pushHierarchy();
  pushMin();
  pushMax();
}

Fixed version (ground truth):
/** 
 * Moves an element down
 */
private void actionMoveDown(){
  if (null == targetRow) {
    return;
  }
  int index=table.indexOf(targetRow);
  if (index >= (table.getItemCount() - 1)) {
    return;
  }
  base.setRedraw(false);
  TableItem o1=table.getItems()[index];
  TableItem o2=table.getItems()[index + 1];
  TableItem n1=new TableItem(table,SWT.NONE,index);
  n1.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n1.setText(i,o1.getText(i));
  }
  TableItem n2=new TableItem(table,SWT.NONE,index);
  n2.setBackground(COLOR);
  for (int i=0; i < table.getColumnCount(); i++) {
    n2.setText(i,o2.getText(i));
  }
  o1.dispose();
  o2.dispose();
  base.setRedraw(true);
  base.redraw();
  targetRow=null;
  updateArray();
  updateCombos();
  pushHierarchy();
  pushMin();
  pushMax();
}
Program: 108440
Project: 108440
Buggy source:
/** 
 * Called when button 3 is clicked on a node
 * @param node
 * @param x
 * @param y
 */
private void actionButtonClicked3(ARXNode node,final int x,final int y){
  selectedNode=node;
  model.setSelectedNode(selectedNode);
  controller.update(new ModelEvent(ViewLattice.this,ModelPart.SELECTED_NODE,selectedNode));
  canvas.redraw();
  menu.setLocation(x,y);
  menu.setVisible(true);
}

Fixed version (ground truth):
/** 
 * Called when button 3 is clicked on a node
 * @param node
 * @param x
 * @param y
 */
private void actionButtonClicked3(ARXNode node,final int x,final int y){
  selectedNode=node;
  model.setSelectedNode(selectedNode);
  controller.update(new ModelEvent(ViewLattice.this,ModelPart.SELECTED_NODE,selectedNode));
  canvas.redraw();
  menu.setLocation(x,y);
  menu.setVisible(true);
  dragType=DragType.NONE;
}
Program: 108442
Project: 108442
Buggy source:
@Override public void mouseDown(MouseEvent arg0){
  dragX=arg0.x;
  dragY=arg0.y;
  dragStartX=arg0.x;
  dragStartY=arg0.y;
  if (dragType == DragType.NONE) {
    if (arg0.button == 1) {
      dragType=DragType.MOVE;
    }
 else     if (arg0.button == 3) {
      dragType=DragType.ZOOM;
    }
  }
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent arg0){
  if (arg0.button == 1) {
    final ARXNode node=getNode(arg0.x,arg0.y);
    if (node != null) {
      actionButtonClicked1(node);
    }
  }
 else   if (arg0.button == 3) {
    final ARXNode node=getNode(arg0.x,arg0.y);
    if (node != null) {
      Point display=canvas.toDisplay(arg0.x,arg0.y);
      actionButtonClicked3(node,display.x,display.y);
    }
  }
}
Program: 108443
Project: 108443
Buggy source:
@Override public TransformedData applyAndSetProperties(final Node transformation){
  currentGroupify=transformer.apply(0L,transformation.getTransformation(),currentGroupify);
  currentGroupify.analyze();
  if (currentGroupify.isAnonymous() && config.getAbsoluteMaxOutliers() != 0) {
    currentGroupify.markOutliers(transformer.getBuffer());
  }
  InformationLoss<?> loss=transformation.getInformationLoss();
  if (loss == null) {
    loss=metric.evaluate(transformation,currentGroupify);
  }
  transformation.setChecked(new Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),loss));
  return new TransformedData(getBuffer(),currentGroupify.getGroupStatistics());
}

Fixed version (ground truth):
@Override public TransformedData applyAndSetProperties(final Node transformation){
  currentGroupify=transformer.apply(0L,transformation.getTransformation(),currentGroupify);
  currentGroupify.analyze();
  InformationLoss<?> loss=transformation.getInformationLoss();
  if (loss == null) {
    loss=metric.evaluate(transformation,currentGroupify);
  }
  if (currentGroupify.isAnonymous() && config.getAbsoluteMaxOutliers() != 0) {
    currentGroupify.markOutliers(transformer.getBuffer());
  }
  transformation.setChecked(new Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),loss));
  return new TransformedData(getBuffer(),currentGroupify.getGroupStatistics());
}
Program: 108444
Project: 108444
Buggy source:
@Override protected InformationLossRCE evaluateInternal(Node node,IHashGroupify g){
  boolean anonymous=g.isAnonymous();
  int[] transformation=node.getTransformation();
  int dimensions=transformation.length;
  double[] scores=new double[dimensions];
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (m.count > 0) {
      if (m.isNotOutlier || !anonymous) {
        for (int dimension=0; dimension < dimensions; dimension++) {
          int value=m.key[dimension];
          double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
          scores[dimension]+=share * gWeight;
        }
      }
 else {
        for (int dimension=0; dimension < dimensions; dimension++) {
          if (sWeight == 1d) {
            double share=(double)m.count;
            scores[dimension]+=share;
          }
 else {
            int value=m.key[dimension] & Data.REMOVE_OUTLIER_MASK;
            double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
            scores[dimension]+=share + sWeight * (1d - share);
          }
        }
      }
    }
    m=m.nextOrdered;
  }
  for (int dimension=0; dimension < dimensions; dimension++) {
    scores[dimension]=normalize(scores[dimension],dimension);
  }
  return new InformationLossRCE(scores,weights);
}

Fixed version (ground truth):
@Override protected InformationLossRCE evaluateInternal(Node node,IHashGroupify g){
  boolean anonymous=g.isAnonymous();
  int[] transformation=node.getTransformation();
  int dimensions=transformation.length;
  double[] scores=new double[dimensions];
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (m.count > 0) {
      if (m.isNotOutlier || !anonymous) {
        for (int dimension=0; dimension < dimensions; dimension++) {
          int value=m.key[dimension];
          double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
          scores[dimension]+=share * gWeight;
        }
      }
 else {
        for (int dimension=0; dimension < dimensions; dimension++) {
          if (sWeight == 1d) {
            double share=(double)m.count;
            scores[dimension]+=share;
          }
 else {
            int value=m.key[dimension];
            double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
            scores[dimension]+=share + sWeight * (1d - share);
          }
        }
      }
    }
    m=m.nextOrdered;
  }
  for (int dimension=0; dimension < dimensions; dimension++) {
    scores[dimension]=normalize(scores[dimension],dimension);
  }
  return new InformationLossRCE(scores,weights);
}
Program: 108445
Project: 108445
Buggy source:
@Override public TransformedData applyAndSetProperties(final Node transformation){
  currentGroupify=transformer.apply(0L,transformation.getTransformation(),currentGroupify);
  currentGroupify.analyze();
  if (transformation.hasProperty(Node.PROPERTY_ANONYMOUS) && config.getAbsoluteMaxOutliers() != 0) {
    currentGroupify.markOutliers(transformer.getBuffer());
  }
  InformationLoss<?> loss=transformation.getInformationLoss();
  if (loss == null) {
    loss=metric.evaluate(transformation,currentGroupify);
  }
  transformation.setChecked(new Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),loss));
  return new TransformedData(getBuffer(),currentGroupify.getGroupStatistics());
}

Fixed version (ground truth):
@Override public TransformedData applyAndSetProperties(final Node transformation){
  currentGroupify=transformer.apply(0L,transformation.getTransformation(),currentGroupify);
  currentGroupify.analyze();
  if (currentGroupify.isAnonymous() && config.getAbsoluteMaxOutliers() != 0) {
    currentGroupify.markOutliers(transformer.getBuffer());
  }
  InformationLoss<?> loss=transformation.getInformationLoss();
  if (loss == null) {
    loss=metric.evaluate(transformation,currentGroupify);
  }
  transformation.setChecked(new Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),loss));
  return new TransformedData(getBuffer(),currentGroupify.getGroupStatistics());
}
Program: 108446
Project: 108446
Buggy source:
@Override public void traverse(){
  FLASHConfiguration outerLoopConfiguration;
  if (binaryPhaseConfiguration.active) {
    outerLoopConfiguration=binaryPhaseConfiguration;
  }
 else {
    outerLoopConfiguration=linearPhaseConfiguration;
  }
  PriorityQueue<Node> queue=new PriorityQueue<Node>(11,strategy);
  INodeChecker.Result result=checker.check(lattice.getBottom(),true);
  lattice.getBottom().setInformationLoss(result.informationLoss);
  lattice.getBottom().setProperty(Node.PROPERTY_FORCE_SNAPSHOT);
  lattice.getBottom().setData(result);
  int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    for (    Node node : this.getUnsetNodesAndSort(i,outerLoopConfiguration.triggerSkip)) {
      if (binaryPhaseConfiguration.active) {
        checker.getHistory().setEvictionTrigger(binaryPhaseConfiguration.triggerSnapshotEvict);
        checker.getHistory().setStorageTrigger(binaryPhaseConfiguration.triggerSnapshotStore);
        binarySearch(node,queue);
      }
 else {
        checker.getHistory().setEvictionTrigger(linearPhaseConfiguration.triggerSnapshotEvict);
        checker.getHistory().setStorageTrigger(linearPhaseConfiguration.triggerSnapshotStore);
        linearSearch(node);
      }
    }
  }
  computeUtilityForMonotonicMetrics(lattice.getBottom());
  computeUtilityForMonotonicMetrics(lattice.getTop());
}

Fixed version (ground truth):
@Override public void traverse(){
  FLASHConfiguration outerLoopConfiguration;
  if (binaryPhaseConfiguration.active) {
    outerLoopConfiguration=binaryPhaseConfiguration;
  }
 else {
    outerLoopConfiguration=linearPhaseConfiguration;
  }
  PriorityQueue<Node> queue=new PriorityQueue<Node>(11,strategy);
  INodeChecker.Result result=checker.check(lattice.getBottom(),true);
  lattice.getBottom().setInformationLoss(result.informationLoss);
  lattice.getBottom().setProperty(Node.PROPERTY_FORCE_SNAPSHOT);
  lattice.getBottom().setData(result);
  int length=lattice.getLevels().length;
  for (int i=0; i < length; i++) {
    for (    Node node : this.getUnsetNodesAndSort(i,outerLoopConfiguration.triggerSkip)) {
      if (binaryPhaseConfiguration.active) {
        checker.getHistory().setEvictionTrigger(binaryPhaseConfiguration.triggerSnapshotEvict);
        checker.getHistory().setStorageTrigger(binaryPhaseConfiguration.triggerSnapshotStore);
        binarySearch(node,queue);
      }
 else {
        checker.getHistory().setEvictionTrigger(linearPhaseConfiguration.triggerSnapshotEvict);
        checker.getHistory().setStorageTrigger(linearPhaseConfiguration.triggerSnapshotStore);
        linearSearch(node);
      }
    }
  }
  computeUtilityForMonotonicMetrics(lattice.getBottom());
  computeUtilityForMonotonicMetrics(lattice.getTop());
  lattice.getBottom().setData(null);
}
Program: 108447
Project: 108447
Buggy source:
/** 
 * Disposes the control
 */
public void dispose(){
  table.dispose();
}

Fixed version (ground truth):
/** 
 * Disposes the control
 */
public void dispose(){
  if (!table.isDisposed())   table.dispose();
}
Program: 108448
Project: 108448
Buggy source:
/** 
 * Sets the current suppression weight
 * @param d
 */
private void setSuppressionWeight(double d){
  int value=(int)(MINIMUM + d * (double)(MAXIMUM - MINIMUM));
  this.slider.setSelection(value);
  this.canvas.redraw();
}

Fixed version (ground truth):
/** 
 * Sets the current suppression weight
 * @param d
 */
private void setSuppressionWeight(double d){
  int value=(int)(MINIMUM + d * (double)(MAXIMUM - MINIMUM));
  if (!this.slider.isDisposed())   this.slider.setSelection(value);
  if (!this.canvas.isDisposed())   this.canvas.redraw();
}
Program: 108449
Project: 108449
Buggy source:
@Override protected InformationLossRCE evaluateInternal(Node node,IHashGroupify g){
  boolean anonymous=g.isAnonymous();
  int[] transformation=node.getTransformation();
  int dimensions=transformation.length;
  double[] scores=new double[dimensions];
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (m.count > 0) {
      if (m.isNotOutlier || !anonymous) {
        for (int dimension=0; dimension < dimensions; dimension++) {
          int value=m.key[dimension];
          double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
          scores[dimension]+=share * gWeight;
        }
      }
 else {
        for (int dimension=0; dimension < dimensions; dimension++) {
          if (sWeight == 1d) {
            double share=(double)m.count;
            scores[dimension]+=share;
          }
 else {
            int value=m.key[dimension];
            double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
            scores[dimension]+=share + sWeight * (1d - share);
          }
        }
      }
    }
    m=m.nextOrdered;
  }
  for (int dimension=0; dimension < dimensions; dimension++) {
    scores[dimension]=normalize(scores[dimension],dimension);
  }
  return new InformationLossRCE(scores,weights);
}

Fixed version (ground truth):
@Override protected InformationLossRCE evaluateInternal(Node node,IHashGroupify g){
  boolean anonymous=g.isAnonymous();
  int[] transformation=node.getTransformation();
  int dimensions=transformation.length;
  double[] scores=new double[dimensions];
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (m.count > 0) {
      if (m.isNotOutlier || !anonymous) {
        for (int dimension=0; dimension < dimensions; dimension++) {
          int value=m.key[dimension];
          double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
          scores[dimension]+=share * gWeight;
        }
      }
 else {
        for (int dimension=0; dimension < dimensions; dimension++) {
          if (sWeight == 1d) {
            double share=(double)m.count;
            scores[dimension]+=share;
          }
 else {
            int value=m.key[dimension] & Data.REMOVE_OUTLIER_MASK;
            double share=(double)m.count * frequencies[dimension][transformation[dimension]][value];
            scores[dimension]+=share + sWeight * (1d - share);
          }
        }
      }
    }
    m=m.nextOrdered;
  }
  for (int dimension=0; dimension < dimensions; dimension++) {
    scores[dimension]=normalize(scores[dimension],dimension);
  }
  return new InformationLossRCE(scores,weights);
}
Program: 108450
Project: 108450
Buggy source:
@Override protected InformationLossDefault evaluateInternal(final Node node,final IHashGroupify g){
  int groups=0;
  int tuples=0;
  boolean suppressed=false;
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (m.count > 0) {
      tuples+=m.count;
      groups+=m.isNotOutlier ? 1 : 0;
      suppressed|=!m.isNotOutlier;
    }
    m=m.nextOrdered;
  }
  groups+=suppressed ? 1 : 0;
  return new InformationLossDefault((double)tuples / (double)groups);
}

Fixed version (ground truth):
@Override protected InformationLossDefault evaluateInternal(final Node node,final IHashGroupify g){
  boolean anonymous=g.isAnonymous();
  int groups=0;
  int tuples=0;
  boolean suppressed=false;
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (m.count > 0) {
      tuples+=m.count;
      groups+=!anonymous || m.isNotOutlier ? 1 : 0;
      suppressed|=!m.isNotOutlier && anonymous;
    }
    m=m.nextOrdered;
  }
  groups+=suppressed ? 1 : 0;
  return new InformationLossDefault((double)tuples / (double)groups);
}
Program: 108451
Project: 108451
Buggy source:
@Override protected InformationLossDefault evaluateInternal(final Node node,final IHashGroupify g){
  final boolean anonymous=node.hasProperty(Node.PROPERTY_ANONYMOUS);
  double value=0;
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (!anonymous || m.isNotOutlier) {
      value+=((double)m.count * (double)m.count);
    }
 else {
      value+=((double)rowCount * (double)m.count);
    }
    m=m.nextOrdered;
  }
  return new InformationLossDefault(value);
}

Fixed version (ground truth):
@Override protected InformationLossDefault evaluateInternal(final Node node,final IHashGroupify g){
  final boolean anonymous=g.isAnonymous();
  double value=0;
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (!anonymous || m.isNotOutlier) {
      value+=((double)m.count * (double)m.count);
    }
 else {
      value+=((double)rowCount * (double)m.count);
    }
    m=m.nextOrdered;
  }
  return new InformationLossDefault(value);
}
Program: 108452
Project: 108452
Buggy source:
@Override @SuppressWarnings("String_Node_Str") protected InformationLossDefault evaluateInternal(final Node node,final IHashGroupify g){
  final InformationLossDefault originalInfoLossDefault=super.evaluateInternal(node,g);
  if (!node.hasProperty(Node.PROPERTY_ANONYMOUS))   return originalInfoLossDefault;
  final double originalInfoLoss=originalInfoLossDefault.getValue();
  double suppressedTuples=0;
  double additionalInfoLoss=0;
  int key;
  Integer val;
  final Map<Integer,Integer>[] original=new Map[node.getTransformation().length];
  for (int i=0; i < original.length; i++) {
    original[i]=new HashMap<Integer,Integer>();
  }
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (!m.isNotOutlier && m.count > 0) {
      suppressedTuples+=m.count;
      for (int i=0; i < original.length; i++) {
        key=m.key[i];
        val=original[i].get(key);
        if (val == null) {
          original[i].put(key,m.count);
        }
 else {
          original[i].put(key,m.count + val);
        }
      }
    }
    m=m.nextOrdered;
  }
  if (suppressedTuples != 0) {
    for (int i=0; i < original.length; i++) {
      for (      final double count : original[i].values()) {
        additionalInfoLoss+=count * MetricEntropy.log2(count / suppressedTuples);
      }
    }
  }
  return new InformationLossDefault(originalInfoLoss - additionalInfoLoss);
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") protected InformationLossDefault evaluateInternal(final Node node,final IHashGroupify g){
  final InformationLossDefault originalInfoLossDefault=super.evaluateInternal(node,g);
  if (!g.isAnonymous())   return originalInfoLossDefault;
  final double originalInfoLoss=originalInfoLossDefault.getValue();
  double suppressedTuples=0;
  double additionalInfoLoss=0;
  int key;
  Integer val;
  final Map<Integer,Integer>[] original=new Map[node.getTransformation().length];
  for (int i=0; i < original.length; i++) {
    original[i]=new HashMap<Integer,Integer>();
  }
  HashGroupifyEntry m=g.getFirstEntry();
  while (m != null) {
    if (!m.isNotOutlier && m.count > 0) {
      suppressedTuples+=m.count;
      for (int i=0; i < original.length; i++) {
        key=m.key[i];
        val=original[i].get(key);
        if (val == null) {
          original[i].put(key,m.count);
        }
 else {
          original[i].put(key,m.count + val);
        }
      }
    }
    m=m.nextOrdered;
  }
  if (suppressedTuples != 0) {
    for (int i=0; i < original.length; i++) {
      for (      final double count : original[i].values()) {
        additionalInfoLoss+=count * MetricEntropy.log2(count / suppressedTuples);
      }
    }
  }
  return new InformationLossDefault(originalInfoLoss - additionalInfoLoss);
}
Program: 108454
Project: 108454
Buggy source:
/** 
 * Greedily finds a path to the top node
 * @param start The node to start the path with. Will be included
 * @param triggerSkip All nodes to which this trigger applies will be skipped
 * @return The path as a list
 */
private List<Node> findPath(Node start,NodeTrigger triggerSkip){
  List<Node> path=new ArrayList<Node>();
  path.add(start);
  boolean found=true;
  while (found) {
    found=false;
    this.sortSuccessors(start);
    for (    final Node candidate : start.getSuccessors()) {
      if (!triggerSkip.appliesTo(candidate)) {
        start=candidate;
        path.add(candidate);
        found=true;
        break;
      }
    }
  }
  return path;
}

Fixed version (ground truth):
/** 
 * Greedily finds a path to the top node
 * @param current The node to start the path with. Will be included
 * @param triggerSkip All nodes to which this trigger applies will be skipped
 * @return The path as a list
 */
private List<Node> findPath(Node current,NodeTrigger triggerSkip){
  List<Node> path=new ArrayList<Node>();
  path.add(current);
  boolean found=true;
  while (found) {
    found=false;
    this.sortSuccessors(current);
    for (    final Node candidate : current.getSuccessors()) {
      if (!triggerSkip.appliesTo(candidate)) {
        current=candidate;
        path.add(candidate);
        found=true;
        break;
      }
    }
  }
  return path;
}
Program: 108455
Project: 108455
Buggy source:
/** 
 * Creates a new instance of the FLASH algorithm
 * @param lattice
 * @param checker
 * @param strategy
 * @return
 */
public static AbstractAlgorithm create(final Lattice lattice,final INodeChecker checker,final FLASHStrategy strategy){
  if ((checker.getConfiguration().getAbsoluteMaxOutliers() == 0) || (checker.getConfiguration().isCriterionMonotonic() && checker.getMetric().isMonotonic()) || (checker.getConfiguration().isPracticalMonotonicity())) {
    return new FLASHAlgorithmBinary(lattice,checker,strategy);
  }
 else {
    if (checker.getConfiguration().getMinimalGroupSize() != Integer.MAX_VALUE) {
      return new FLASHAlgorithmTwoPhases(lattice,checker,strategy);
    }
 else {
      return new FLASHAlgorithmLinear(lattice,checker,strategy);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the FLASH algorithm
 * @param lattice
 * @param checker
 * @param strategy
 * @return
 */
public static AbstractAlgorithm create(final Lattice lattice,final INodeChecker checker,final FLASHStrategy strategy){
  ARXConfiguration config=checker.getConfiguration();
  Metric<?> metric=checker.getMetric();
  Monotonicity monotonicityMetric;
  if (metric.isMonotonic() || config.getMaxOutliers() == 0d || config.isPracticalMonotonicity()) {
    monotonicityMetric=Monotonicity.FULL;
  }
 else {
    monotonicityMetric=Monotonicity.NONE;
  }
  Monotonicity monotonicityCriteria;
  if (config.getMaxOutliers() == 0d || config.isPracticalMonotonicity()) {
    monotonicityCriteria=Monotonicity.FULL;
  }
 else {
    if (config.getMinimalGroupSize() != Integer.MAX_VALUE) {
      if (config.getCriteria().size() == 1 && config.containsCriterion(KAnonymity.class)) {
        monotonicityCriteria=Monotonicity.FULL;
      }
 else {
        monotonicityCriteria=Monotonicity.PARTIAL;
      }
    }
 else {
      monotonicityCriteria=Monotonicity.NONE;
    }
  }
  if (monotonicityCriteria == Monotonicity.FULL && monotonicityMetric == Monotonicity.FULL) {
    return createFullFull(lattice,checker,strategy);
  }
  if (monotonicityCriteria == Monotonicity.FULL && monotonicityMetric == Monotonicity.NONE) {
    return createFullNone(lattice,checker,strategy);
  }
  if (monotonicityCriteria == Monotonicity.PARTIAL && monotonicityMetric == Monotonicity.FULL) {
    return createPartialFull(lattice,checker,strategy);
  }
  if (monotonicityCriteria == Monotonicity.PARTIAL && monotonicityMetric == Monotonicity.NONE) {
    return createPartialNone(lattice,checker,strategy);
  }
  if (monotonicityCriteria == Monotonicity.NONE && monotonicityMetric == Monotonicity.FULL) {
    return createNoneFull(lattice,checker,strategy);
  }
  if (monotonicityCriteria == Monotonicity.NONE && monotonicityMetric == Monotonicity.NONE) {
    return createNoneNone(lattice,checker,strategy);
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 108456
Project: 108456
Buggy source:
/** 
 * Checks and tags the given transformation
 * @param node
 */
private void checkAndTag(Node node,FLASHConfiguration configuration){
  if (configuration.triggerEvaluate.appliesTo(node)) {
    node.setInformationLoss(checker.getMetric().evaluate(node,null));
  }
 else   if (configuration.triggerCheck.appliesTo(node)) {
    node.setChecked(checker.check(node));
  }
  configuration.triggerTag.apply(node);
}

Fixed version (ground truth):
/** 
 * Checks and tags the given transformation
 * @param node
 */
private void checkAndTag(Node node,FLASHConfiguration configuration){
  if (configuration.triggerEvaluate.appliesTo(node)) {
    node.setInformationLoss(checker.getMetric().evaluate(node,null));
  }
 else   if (configuration.triggerCheck.appliesTo(node)) {
    node.setChecked(checker.check(node));
  }
  trackOptimum(node);
  configuration.triggerTag.apply(node);
}
Program: 108458
Project: 108458
Buggy source:
@Override public TransformedData applyAndSetProperties(final Node transformation){
  currentGroupify.clear();
  currentGroupify=transformer.apply(0L,transformation.getTransformation(),currentGroupify);
  if (transformation.hasProperty(Node.PROPERTY_ANONYMOUS) && config.getAbsoluteMaxOutliers() != 0) {
    currentGroupify.markOutliers(transformer.getBuffer());
  }
  InformationLoss loss=transformation.getInformationLoss();
  if (loss == null) {
    loss=metric.evaluate(transformation,currentGroupify);
  }
  transformation.setChecked(new Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),loss));
  return new TransformedData(getBuffer(),currentGroupify.getGroupStatistics(transformation.hasProperty(Node.PROPERTY_ANONYMOUS)));
}

Fixed version (ground truth):
@Override public TransformedData applyAndSetProperties(final Node transformation){
  currentGroupify.clear();
  currentGroupify=transformer.apply(0L,transformation.getTransformation(),currentGroupify);
  currentGroupify.analyze();
  if (transformation.hasProperty(Node.PROPERTY_ANONYMOUS) && config.getAbsoluteMaxOutliers() != 0) {
    currentGroupify.markOutliers(transformer.getBuffer());
  }
  InformationLoss loss=transformation.getInformationLoss();
  if (loss == null) {
    loss=metric.evaluate(transformation,currentGroupify);
  }
  transformation.setChecked(new Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),loss));
  return new TransformedData(getBuffer(),currentGroupify.getGroupStatistics());
}
Program: 108459
Project: 108459
Buggy source:
@Override public INodeChecker.Result check(final Node node,final boolean forceMeasureInfoLoss){
  if (stateMachine.getLastNode() != null) {
    history.store(stateMachine.getLastNode(),currentGroupify,stateMachine.getLastTransition().snapshot);
  }
  final Transition transition=stateMachine.transition(node);
  final IHashGroupify temp=lastGroupify;
  lastGroupify=currentGroupify;
  currentGroupify=temp;
  currentGroupify.clear();
switch (transition.type) {
case UNOPTIMIZED:
    currentGroupify=transformer.apply(transition.projection,node.getTransformation(),currentGroupify);
  break;
case ROLLUP:
currentGroupify=transformer.applyRollup(transition.projection,node.getTransformation(),lastGroupify,currentGroupify);
break;
case SNAPSHOT:
currentGroupify=transformer.applySnapshot(transition.projection,node.getTransformation(),currentGroupify,transition.snapshot);
break;
}
InformationLoss infoLoss=(currentGroupify.isAnonymous() || forceMeasureInfoLoss) ? metric.evaluate(node,currentGroupify) : null;
return new INodeChecker.Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),infoLoss);
}

Fixed version (ground truth):
@Override public INodeChecker.Result check(final Node node,final boolean forceMeasureInfoLoss){
  if (stateMachine.getLastNode() != null) {
    history.store(stateMachine.getLastNode(),currentGroupify,stateMachine.getLastTransition().snapshot);
  }
  final Transition transition=stateMachine.transition(node);
  final IHashGroupify temp=lastGroupify;
  lastGroupify=currentGroupify;
  currentGroupify=temp;
  currentGroupify.clear();
switch (transition.type) {
case UNOPTIMIZED:
    currentGroupify=transformer.apply(transition.projection,node.getTransformation(),currentGroupify);
  break;
case ROLLUP:
currentGroupify=transformer.applyRollup(transition.projection,node.getTransformation(),lastGroupify,currentGroupify);
break;
case SNAPSHOT:
currentGroupify=transformer.applySnapshot(transition.projection,node.getTransformation(),currentGroupify,transition.snapshot);
break;
}
currentGroupify.analyze();
InformationLoss infoLoss=(currentGroupify.isAnonymous() || forceMeasureInfoLoss) ? metric.evaluate(node,currentGroupify) : null;
return new INodeChecker.Result(currentGroupify.isAnonymous(),currentGroupify.isKAnonymous(),infoLoss);
}
Program: 108460
Project: 108460
Buggy source:
@Override public void markOutliers(final int[][] data){
  for (int row=0; row < data.length; row++) {
    final int[] key=data[row];
    final int hash=HashTableUtil.hashcode(key);
    final int index=hash & (buckets.length - 1);
    HashGroupifyEntry m=buckets[index];
    while ((m != null) && ((m.hashcode != hash) || !equalsIgnoringOutliers(key,m.key))) {
      m=m.next;
    }
    if (m == null) {
      throw new RuntimeException("String_Node_Str");
    }
    if (!m.isNotOutlier) {
      key[0]|=Data.OUTLIER_MASK;
    }
  }
}

Fixed version (ground truth):
@Override public void markOutliers(final int[][] data){
  if (!anonymous)   return;
  for (int row=0; row < data.length; row++) {
    final int[] key=data[row];
    final int hash=HashTableUtil.hashcode(key);
    final int index=hash & (buckets.length - 1);
    HashGroupifyEntry m=buckets[index];
    while ((m != null) && ((m.hashcode != hash) || !equalsIgnoringOutliers(key,m.key))) {
      m=m.next;
    }
    if (m == null) {
      throw new RuntimeException("String_Node_Str");
    }
    if (!m.isNotOutlier) {
      key[0]|=Data.OUTLIER_MASK;
    }
  }
}
Program: 108461
Project: 108461
Buggy source:
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(DPresence.class)) {
    subset=config.getCriterion(DPresence.class).getSubset().getSet();
  }
 else {
    subset=null;
  }
  criteria=config.getCriteriaAsArray();
  k=config.getMinimalGroupSize();
}

Fixed version (ground truth):
/** 
 * Constructs a new hash groupify operator
 * @param capacity The capacity
 * @param config The config
 */
public HashGroupify(int capacity,final ARXConfiguration config){
  capacity=HashTableUtil.calculateCapacity(capacity);
  this.elementCount=0;
  this.buckets=new HashGroupifyEntry[capacity];
  this.threshold=HashTableUtil.calculateThreshold(buckets.length,loadFactor);
  this.currentOutliers=0;
  this.absoluteMaxOutliers=config.getAbsoluteMaxOutliers();
  if (config.containsCriterion(DPresence.class)) {
    this.subset=config.getCriterion(DPresence.class).getSubset().getSet();
  }
 else {
    this.subset=null;
  }
  this.criteria=config.getCriteriaAsArray();
  this.k=config.getMinimalGroupSize();
}
Program: 108463
Project: 108463
Buggy source:
/** 
 * Is the current transformation k-anonymous? CAUTION: Call before isAnonymous()!
 * @return
 */
@Override public boolean isKAnonymous(){
  if (currentOutliers > absoluteMaxOutliers) {
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean isKAnonymous(){
  return kAnonymous;
}
Program: 108464
Project: 108464
Buggy source:
/** 
 * Min groupsize greater equals.
 * @return true, if successful
 */
public abstract boolean isAnonymous();

Fixed version (ground truth):
/** 
 * Are all defined privacy criteria fulfilled by this transformation, given the specified limit on suppressed tuples
 * @return true, if successful
 */
public abstract boolean isAnonymous();
Program: 108465
Project: 108465
Buggy source:
/** 
 * Returns statistics about the groups
 * @return
 */
public abstract GroupStatistics getGroupStatistics(boolean anonymous);

Fixed version (ground truth):
/** 
 * Returns statistics about the groups
 * @return
 */
public abstract GroupStatistics getGroupStatistics();
Program: 108466
Project: 108466
Buggy source:
/** 
 * Is it k-anonymous?
 * @return
 */
public abstract boolean isKAnonymous();

Fixed version (ground truth):
/** 
 * Is the current transformation k-anonymous. Always returns true, if no k-anonymity (sub-)criterion was specified
 * @return
 */
public abstract boolean isKAnonymous();