nus-yam/ex-repair huggingface dataset:
Program: 108908
Project: 108908
Buggy source:
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  final GridLayout l=new GridLayout();
  l.numColumns=2;
  parent.setLayout(l);
  table=new Table(parent,SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
  GridData d=SWTUtil.createFillGridData();
  d.horizontalSpan=2;
  d.grabExcessHorizontalSpace=true;
  d.grabExcessVerticalSpace=true;
  table.setLayoutData(d);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  try {
    detect(file);
    read(file);
  }
 catch (  final Exception e) {
    controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + e.getMessage());
    close();
  }
  final Combo combo=new Combo(parent,SWT.NONE);
  d=SWTUtil.createFillHorizontallyGridData();
  d.horizontalSpan=2;
  combo.setLayoutData(d);
  for (  final String s : labels) {
    combo.add(s);
  }
  combo.select(selection);
  combo.pack();
  combo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      try {
        if (combo.getSelectionIndex() == -1) {
          return;
        }
        selection=combo.getSelectionIndex();
        read(file);
      }
 catch (      final Exception e) {
        controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + e.getMessage());
        close();
      }
    }
  }
);
  return parent;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  final GridLayout l=new GridLayout();
  l.numColumns=2;
  parent.setLayout(l);
  table=new Table(parent,SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
  GridData d=SWTUtil.createFillGridData();
  d.horizontalSpan=2;
  d.grabExcessHorizontalSpace=true;
  d.grabExcessVerticalSpace=true;
  table.setLayoutData(d);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  try {
    detect(file);
    read(file);
  }
 catch (  final Exception e) {
    controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
    close();
  }
  final Combo combo=new Combo(parent,SWT.NONE);
  d=SWTUtil.createFillHorizontallyGridData();
  d.horizontalSpan=2;
  combo.setLayoutData(d);
  for (  final String s : labels) {
    combo.add(s);
  }
  combo.select(selection);
  combo.pack();
  combo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      try {
        if (combo.getSelectionIndex() == -1) {
          return;
        }
        selection=combo.getSelectionIndex();
        read(file);
      }
 catch (      final Exception e) {
        controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
        close();
      }
    }
  }
);
  return parent;
}
Program: 108912
Project: 108912
Buggy source:
/** 
 * Instantiates a new ARX result.
 * @param manager The data manager
 * @param checker The node checker
 * @param time The elapsed wall-clock  time
 * @param suppressionString The suppression string
 * @param definition The data definition
 * @param lattice The lattice
 * @param practicalMonotonicity Do we assume practical monotonicity
 * @param removeOutliers Do we remove outliers
 * @param maximumAbsoluteOutliers The maximum number of outliers
 * @param config The configuration
 * @param projection A projection mask for results of iterative executions.projection[i] must contain true if the ith QI is to be preserved
 */
public DataHandleOutput(final DataRegistry registry,final DataManager manager,final INodeChecker checker,final long time,final String suppressionString,final DataDefinition definition,final Lattice lattice,final boolean removeOutliers,final ARXConfiguration config){
  registry.updateOutput(this);
  this.setRegistry(registry);
  final ARXLattice flattice=new ARXLattice(lattice,manager.getDataQI().getHeader(),config);
  init(manager,checker,time,suppressionString,definition,flattice,removeOutliers,config);
}

Fixed version (ground truth):
/** 
 * Instantiates a new ARX result.
 * @param manager The data manager
 * @param checker The node checker
 * @param time The elapsed wall-clock  time
 * @param suppressionString The suppression string
 * @param definition The data definition
 * @param lattice The lattice
 * @param practicalMonotonicity Do we assume practical monotonicity
 * @param removeOutliers Do we remove outliers
 * @param maximumAbsoluteOutliers The maximum number of outliers
 * @param config The configuration
 * @param projection A projection mask for results of iterative executions.projection[i] must contain true if the ith QI is to be preserved
 */
public DataHandleOutput(final DataRegistry registry,final DataManager manager,final INodeChecker checker,final long time,final String suppressionString,final DataDefinition definition,final Lattice lattice,final boolean removeOutliers,final ARXConfiguration config){
  registry.updateOutput(this);
  this.setRegistry(registry);
  this.source=checker.getData();
  final ARXLattice flattice=new ARXLattice(lattice,manager.getDataQI().getHeader(),config);
  init(manager,checker,time,suppressionString,definition,flattice,removeOutliers,config);
}
Program: 108913
Project: 108913
Buggy source:
/** 
 * Swap internal.
 * @param row1 the row1
 * @param row2 the row2
 */
protected void internalSwap(final int row1,final int row2){
  getHandle(currentNode);
  int[] temp=dataQI.getArray()[row1];
  dataQI.getArray()[row1]=dataQI.getArray()[row2];
  dataQI.getArray()[row2]=temp;
  temp=dataSE.getArray()[row1];
  dataSE.getArray()[row1]=dataSE.getArray()[row2];
  dataSE.getArray()[row2]=temp;
  temp=dataIS.getArray()[row1];
  dataIS.getArray()[row1]=dataIS.getArray()[row2];
  dataIS.getArray()[row2]=temp;
}

Fixed version (ground truth):
/** 
 * Swap internal.
 * @param row1 the row1
 * @param row2 the row2
 */
protected void internalSwap(final int row1,final int row2){
  getHandle(currentNode);
  int[] temp=dataQI.getArray()[row1];
  dataQI.getArray()[row1]=dataQI.getArray()[row2];
  dataQI.getArray()[row2]=temp;
  temp=dataSE.getArray()[row1];
  dataSE.getArray()[row1]=dataSE.getArray()[row2];
  dataSE.getArray()[row2]=temp;
  temp=dataIS.getArray()[row1];
  dataIS.getArray()[row1]=dataIS.getArray()[row2];
  dataIS.getArray()[row2]=temp;
  temp=source.getArray()[row1];
  source.getArray()[row1]=source.getArray()[row2];
  source.getArray()[row2]=temp;
}
Program: 108914
Project: 108914
Buggy source:
@Test public void testSubset5() throws IllegalArgumentException, IOException {
  Data data=Data.create("String_Node_Str",';');
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",AttributeType.INSENSITIVE_ATTRIBUTE);
  DataSelector selector=DataSelector.create(data).field("String_Node_Str").equals("String_Node_Str");
  DataSubset subset=DataSubset.create(data,selector);
  final ARXAnonymizer anonymizer=new ARXAnonymizer();
  final ARXConfiguration config=ARXConfiguration.create();
  config.addCriterion(new Inclusion(subset));
  ARXResult result=anonymizer.anonymize(data,config);
  data.getHandle().sort(true,0,1,2);
  String[][] given=iteratorToArray(data.getHandle().getView().iterator());
  printArray(given);
  ARXNode n=result.getLattice().getLevels()[2][1];
  DataHandle h=result.getHandle(n);
  String[][] given2=iteratorToArray(h.getView().iterator());
  printArray(given2);
  String[][] expected={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  assertTrue(Arrays.deepEquals(given2,expected));
}

Fixed version (ground truth):
@Test public void testSubset5() throws IllegalArgumentException, IOException {
  Data data=Data.create("String_Node_Str",';');
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",AttributeType.INSENSITIVE_ATTRIBUTE);
  DataSelector selector=DataSelector.create(data).field("String_Node_Str").equals("String_Node_Str");
  DataSubset subset=DataSubset.create(data,selector);
  final ARXAnonymizer anonymizer=new ARXAnonymizer();
  final ARXConfiguration config=ARXConfiguration.create();
  config.addCriterion(new Inclusion(subset));
  ARXResult result=anonymizer.anonymize(data,config);
  data.getHandle().sort(true,0,1,2);
  ARXNode n=result.getLattice().getLevels()[2][1];
  DataHandle h=result.getHandle(n);
  String[][] given=iteratorToArray(h.getView().iterator());
  String[][] expected={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  assertTrue(Arrays.deepEquals(given,expected));
}
Program: 108915
Project: 108915
Buggy source:
/** 
 * Gets the handle.
 * @return the handle
 */
@Override public DataHandle getHandle(final ARXNode fnode){
  currentNode=fnode;
  if ((currentNode != null) && (currentNode == lastNode)) {
    return this;
  }
  lastNode=currentNode;
  final Node node=new Node(0);
  int level=0;
  for (  int i : fnode.getTransformation())   level+=i;
  node.setTransformation(fnode.getTransformation(),level);
  if (currentNode.isChecked()) {
    node.setChecked();
  }
  checker.transformAndMarkOutliers(node);
  if (!currentNode.isChecked()) {
    currentNode.access().setChecked(true);
    if (config.isPracticalMonotonicity()) {
      if (node.isAnonymous()) {
        currentNode.access().setAnonymous();
      }
 else {
        currentNode.access().setNotAnonymous();
      }
    }
    currentNode.access().setMaximumInformationLoss(node.getInformationLoss());
    currentNode.access().setMinimumInformationLoss(node.getInformationLoss());
    lattice.estimateInformationLoss();
  }
  createDataTypeArray();
  return this;
}

Fixed version (ground truth):
/** 
 * Gets the handle.
 * @return the handle
 */
@Override public DataHandle getHandle(final ARXNode fnode){
  currentNode=fnode;
  if ((currentNode != null) && (currentNode == lastNode)) {
    return this;
  }
  lastNode=currentNode;
  final Node node=new Node(0);
  int level=0;
  for (  int i : fnode.getTransformation())   level+=i;
  node.setTransformation(fnode.getTransformation(),level);
  if (currentNode.isChecked()) {
    node.setChecked();
  }
  checker.transformAndMarkOutliers(node);
  if (!currentNode.isChecked()) {
    currentNode.access().setChecked(true);
    if (definition.getSensitiveAttributes().size() <= 1) {
      if (node.isAnonymous()) {
        currentNode.access().setAnonymous();
      }
 else {
        currentNode.access().setNotAnonymous();
      }
    }
    currentNode.access().setMaximumInformationLoss(node.getInformationLoss());
    currentNode.access().setMinimumInformationLoss(node.getInformationLoss());
    lattice.estimateInformationLoss();
  }
  createDataTypeArray();
  return this;
}
Program: 108917
Project: 108917
Buggy source:
@Override public void run(final IProgressMonitor arg0) throws InvocationTargetException, InterruptedException {
  arg0.beginTask(Resources.getMessage("String_Node_Str"),8);
  try {
    final ZipFile zip=zipfile;
    readMetadata(zip);
    arg0.worked(1);
    readModel(zip);
    arg0.worked(2);
    final Map<String,ARXNode> map=readLattice(zip);
    arg0.worked(3);
    readClipboard(map,zip);
    arg0.worked(4);
    readFilter(zip);
    arg0.worked(5);
    readConfiguration(map,zip);
    arg0.worked(6);
    zip.close();
    arg0.worked(7);
  }
 catch (  final Exception e) {
    error=e;
    arg0.done();
    return;
  }
  result=model;
  arg0.worked(8);
  arg0.done();
}

Fixed version (ground truth):
@Override public void run(final IProgressMonitor arg0) throws InvocationTargetException, InterruptedException {
  arg0.beginTask(Resources.getMessage("String_Node_Str"),8);
  try {
    final ZipFile zip=zipfile;
    readMetadata(zip);
    arg0.worked(1);
    readModel(zip);
    arg0.worked(2);
    final Map<String,ARXNode> map=readLattice(zip);
    arg0.worked(3);
    readClipboard(map,zip);
    arg0.worked(4);
    readFilter(zip);
    arg0.worked(5);
    readConfiguration(map,zip);
    arg0.worked(6);
    zip.close();
    arg0.worked(7);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    error=e;
    arg0.done();
    return;
  }
  result=model;
  arg0.worked(8);
  arg0.done();
}
Program: 108918
Project: 108918
Buggy source:
@Test public void testSubset5() throws IllegalArgumentException, IOException {
  Data data=Data.create("String_Node_Str",';');
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",AttributeType.INSENSITIVE_ATTRIBUTE);
  DataSelector selector=DataSelector.create(data).field("String_Node_Str").equals("String_Node_Str");
  DataSubset subset=DataSubset.create(data,selector);
  final ARXAnonymizer anonymizer=new ARXAnonymizer();
  final ARXConfiguration config=ARXConfiguration.create();
  config.addCriterion(new Inclusion(subset));
  ARXResult result=anonymizer.anonymize(data,config);
  data.getHandle().sort(true,0,1,2);
  String[][] given=iteratorToArray(data.getHandle().getView().iterator());
  printArray(given);
  ARXNode n=result.getLattice().getLevels()[2][1];
  DataHandle h=result.getHandle(n);
  String[][] given2=iteratorToArray(h.getView().iterator());
  printArray(given2);
  String[][] expected={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  assertTrue(Arrays.deepEquals(given,expected));
}

Fixed version (ground truth):
@Test public void testSubset5() throws IllegalArgumentException, IOException {
  Data data=Data.create("String_Node_Str",';');
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",Hierarchy.create("String_Node_Str",';'));
  data.getDefinition().setAttributeType("String_Node_Str",AttributeType.INSENSITIVE_ATTRIBUTE);
  DataSelector selector=DataSelector.create(data).field("String_Node_Str").equals("String_Node_Str");
  DataSubset subset=DataSubset.create(data,selector);
  final ARXAnonymizer anonymizer=new ARXAnonymizer();
  final ARXConfiguration config=ARXConfiguration.create();
  config.addCriterion(new Inclusion(subset));
  ARXResult result=anonymizer.anonymize(data,config);
  data.getHandle().sort(true,0,1,2);
  String[][] given=iteratorToArray(data.getHandle().getView().iterator());
  printArray(given);
  ARXNode n=result.getLattice().getLevels()[2][1];
  DataHandle h=result.getHandle(n);
  String[][] given2=iteratorToArray(h.getView().iterator());
  printArray(given2);
  String[][] expected={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  assertTrue(Arrays.deepEquals(given2,expected));
}
Program: 108919
Project: 108919
Buggy source:
public static void main(final String[] args){
  try {
    splash=new Splash();
    splash.setVisible(true);
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    if (splash != null) {
      hideSplash();
    }
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  try {
    splash=new MainSplash();
    splash.setVisible(true);
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    if (splash != null) {
      hideSplash();
    }
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}
Program: 108921
Project: 108921
Buggy source:
/** 
 * Reset a previous lattice and run the algorithm 
 * @param handle
 * @param definition
 * @param config
 * @param lattice
 * @param algorithm
 * @return
 * @throws IOException
 */
protected Result anonymizeInternal(final DataHandle handle,final DataDefinition definition,final ARXConfiguration config,Lattice lattice,int multiplier,AbstractAlgorithm algorithm) throws IOException {
  final DataManager manager=prepareDataManager(handle,definition,config);
  config.initialize(manager);
  checkAfterEncoding(config,manager);
  if (lattice == null) {
    lattice=new LatticeBuilder(manager.getMaxLevels(),manager.getMinLevels(),manager.getHierachyHeights()).build();
  }
  lattice.setListener(listener);
  lattice.setMultiplier(multiplier);
  final INodeChecker checker=new NodeChecker(manager,config.getMetric(),config,historySize,snapshotSizeDataset,snapshotSizeSnapshot);
  config.getMetric().initialize(manager.getDataQI(),manager.getHierarchies(),config);
  if (algorithm != null) {
    algorithm=FLASHAlgorithm.create((AbstractFLASHAlgorithm)algorithm,checker);
  }
 else {
    algorithm=FLASHAlgorithm.create(lattice,checker,new FLASHStrategy(lattice,manager.getHierarchies()));
  }
  algorithm.traverse();
  checker.getHistory().reset();
  checker.getHistory().setSize(0);
  return new Result(config.getMetric(),checker,lattice,manager,algorithm);
}

Fixed version (ground truth):
/** 
 * Reset a previous lattice and run the algorithm 
 * @param handle
 * @param definition
 * @param config
 * @param lattice
 * @param algorithm
 * @return
 * @throws IOException
 */
protected Result anonymizeInternal(final DataHandle handle,final DataDefinition definition,final ARXConfiguration config,Lattice lattice,int multiplier,AbstractAlgorithm algorithm,LatticeManipulator manipulator) throws IOException {
  final DataManager manager=prepareDataManager(handle,definition,config);
  config.initialize(manager);
  checkAfterEncoding(config,manager);
  if (lattice == null) {
    lattice=new LatticeBuilder(manager.getMaxLevels(),manager.getMinLevels(),manager.getHierachyHeights()).build();
    if (manipulator != null) {
      for (      Node[] level : lattice.getLevels()) {
        for (        Node node : level) {
          manipulator.process(lattice,node);
        }
      }
    }
  }
  lattice.setListener(listener);
  lattice.setMultiplier(multiplier);
  final INodeChecker checker=new NodeChecker(manager,config.getMetric(),config,historySize,snapshotSizeDataset,snapshotSizeSnapshot);
  config.getMetric().initialize(manager.getDataQI(),manager.getHierarchies(),config);
  if (algorithm != null) {
    algorithm=FLASHAlgorithm.create((AbstractFLASHAlgorithm)algorithm,checker);
  }
 else {
    algorithm=FLASHAlgorithm.create(lattice,checker,new FLASHStrategy(lattice,manager.getHierarchies()));
  }
  algorithm.traverse();
  checker.getHistory().reset();
  checker.getHistory().setSize(0);
  return new Result(config.getMetric(),checker,lattice,manager,algorithm);
}
Program: 108922
Project: 108922
Buggy source:
/** 
 * Gets the handle.
 * @return the handle
 */
@Override public DataHandle getHandle(final ARXNode fnode){
  currentNode=fnode;
  if ((currentNode != null) && (currentNode == lastNode)) {
    return this;
  }
  lastNode=currentNode;
  final Node node=new Node(0);
  int level=0;
  for (  int i : fnode.getTransformation())   level+=i;
  node.setTransformation(fnode.getTransformation(),level);
  if (currentNode.isChecked()) {
    node.setChecked();
  }
  checker.transformAndMarkOutliers(node);
  if (!currentNode.isChecked()) {
    currentNode.access().setChecked(true);
    if (node.isAnonymous()) {
      currentNode.access().setAnonymous();
    }
 else {
      currentNode.access().setNotAnonymous();
    }
    currentNode.access().setMaximumInformationLoss(node.getInformationLoss());
    currentNode.access().setMinimumInformationLoss(node.getInformationLoss());
    lattice.estimateInformationLoss();
  }
  createDataTypeArray();
  return this;
}

Fixed version (ground truth):
/** 
 * Gets the handle.
 * @return the handle
 */
@Override public DataHandle getHandle(final ARXNode fnode){
  currentNode=fnode;
  if ((currentNode != null) && (currentNode == lastNode)) {
    return this;
  }
  lastNode=currentNode;
  final Node node=new Node(0);
  int level=0;
  for (  int i : fnode.getTransformation())   level+=i;
  node.setTransformation(fnode.getTransformation(),level);
  if (currentNode.isChecked()) {
    node.setChecked();
  }
  checker.transformAndMarkOutliers(node);
  if (!currentNode.isChecked()) {
    currentNode.access().setChecked(true);
    if (config.isPracticalMonotonicity()) {
      if (node.isAnonymous()) {
        currentNode.access().setAnonymous();
      }
 else {
        currentNode.access().setNotAnonymous();
      }
    }
    currentNode.access().setMaximumInformationLoss(node.getInformationLoss());
    currentNode.access().setMinimumInformationLoss(node.getInformationLoss());
    lattice.estimateInformationLoss();
  }
  createDataTypeArray();
  return this;
}
Program: 108923
Project: 108923
Buggy source:
/** 
 * Checks the bottom node
 */
protected void checkBottom(){
  for (  final Node[] level : lattice.getLevels()) {
    if (level.length != 0) {
      if (level.length == 1) {
        checker.check(level[0]);
        break;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Checks the bottom node
 */
protected void checkBottom(){
  for (  final Node[] level : lattice.getLevels()) {
    if (level.length != 0) {
      if (level.length == 1) {
        Node node=level[0];
        if (!node.isChecked())         checker.check(level[0]);
        break;
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
}
Program: 108924
Project: 108924
Buggy source:
@Override public void paint(final Graphics g){
  final Graphics bg=buffer.getGraphics();
  if (model != null) {
    draw(bg);
  }
 else {
    bg.setColor(Color.WHITE);
    bg.fillRect(0,0,buffer.getWidth(),buffer.getHeight());
  }
  bg.dispose();
  g.drawImage(buffer,0,0,this);
}

Fixed version (ground truth):
@Override public void paint(final Graphics g){
  if (buffer != null) {
    final Graphics bg=buffer.getGraphics();
    if (model != null) {
      draw(bg);
    }
 else {
      bg.setColor(Color.WHITE);
      bg.fillRect(0,0,buffer.getWidth(),buffer.getHeight());
    }
    bg.dispose();
    g.drawImage(buffer,0,0,this);
  }
}
Program: 108926
Project: 108926
Buggy source:
public ARXConfiguration createSubsetConfig(){
  ARXConfiguration config=ARXConfiguration.create();
  DataSubset subset=DataSubset.create(getInputConfig().getInput(),getInputConfig().getResearchSubset());
  config.addCriterion(new Enclosure(subset));
  return config;
}

Fixed version (ground truth):
public ARXConfiguration createSubsetConfig(){
  ARXConfiguration config=ARXConfiguration.create();
  DataSubset subset=DataSubset.create(getInputConfig().getInput(),getInputConfig().getResearchSubset());
  config.addCriterion(new Inclusion(subset));
  return config;
}
Program: 108927
Project: 108927
Buggy source:
public void createCriteria(ModelConfiguration config){
  config.removeAllCriteria();
  if (this.kAnonymityModel != null && this.kAnonymityModel.isActive() && this.kAnonymityModel.isEnabled()) {
    config.addCriterion(this.kAnonymityModel.getCriterion(this));
  }
  if (this.dPresenceModel != null && this.dPresenceModel.isActive() && this.dPresenceModel.isEnabled()) {
    config.addCriterion(this.dPresenceModel.getCriterion(this));
  }
  for (  Entry<String,ModelLDiversityCriterion> entry : this.lDiversityModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  for (  Entry<String,ModelTClosenessCriterion> entry : this.tClosenessModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    DataSubset subset=DataSubset.create(getInputConfig().getInput(),getInputConfig().getResearchSubset());
    config.addCriterion(new Enclosure(subset));
  }
}

Fixed version (ground truth):
public void createCriteria(ModelConfiguration config){
  config.removeAllCriteria();
  if (this.kAnonymityModel != null && this.kAnonymityModel.isActive() && this.kAnonymityModel.isEnabled()) {
    config.addCriterion(this.kAnonymityModel.getCriterion(this));
  }
  if (this.dPresenceModel != null && this.dPresenceModel.isActive() && this.dPresenceModel.isEnabled()) {
    config.addCriterion(this.dPresenceModel.getCriterion(this));
  }
  for (  Entry<String,ModelLDiversityCriterion> entry : this.lDiversityModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  for (  Entry<String,ModelTClosenessCriterion> entry : this.tClosenessModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    DataSubset subset=DataSubset.create(getInputConfig().getInput(),getInputConfig().getResearchSubset());
    config.addCriterion(new Inclusion(subset));
  }
}
Program: 108928
Project: 108928
Buggy source:
@Override public ModelConfiguration clone(){
  final ModelConfiguration c=new ModelConfiguration();
  c.removeOutliers=removeOutliers;
  c.input=input.clone();
  c.config=config.clone();
  c.hierarchies=new HashMap<String,Hierarchy>(hierarchies);
  c.researchSubset=researchSubset;
  return c;
}

Fixed version (ground truth):
@Override public ModelConfiguration clone(){
  final ModelConfiguration c=new ModelConfiguration();
  c.removeOutliers=removeOutliers;
  c.input=input.clone();
  c.config=config.clone();
  c.hierarchies=new HashMap<String,Hierarchy>(hierarchies);
  c.researchSubset=this.getCriterion(DPresence.class).getSubset().getSet();
  return c;
}
Program: 108929
Project: 108929
Buggy source:
/** 
 * Constructor
 * @param path
 * @param controller
 * @throws IOException
 */
public WorkerLoad(final String path,final Controller controller) throws IOException {
  zipfile=new ZipFile(path);
  this.controller=controller;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param path
 * @param controller
 * @throws IOException
 */
public WorkerLoad(final String path,final Controller controller) throws IOException {
  this.zipfile=new ZipFile(path);
  this.controller=controller;
}
Program: 108930
Project: 108930
Buggy source:
@Override public void run(final IProgressMonitor arg0) throws InvocationTargetException, InterruptedException {
  arg0.beginTask(Resources.getMessage("String_Node_Str"),10);
  try {
    final FileOutputStream f=new FileOutputStream(path);
    final ZipOutputStream zip=new ZipOutputStream(new BufferedOutputStream(f));
    writeMetadata(model,zip);
    arg0.worked(1);
    writeModel(model,zip);
    arg0.worked(2);
    writeInput(model,zip);
    arg0.worked(3);
    writeInputSubset(model,zip);
    arg0.worked(4);
    writeOutput(model,zip);
    arg0.worked(5);
    writeOutputSubset(model,zip);
    arg0.worked(6);
    writeConfiguration(model,zip);
    arg0.worked(7);
    final Map<String,Integer> map=writeLattice(model,zip);
    arg0.worked(8);
    writeClipboard(model,map,zip);
    arg0.worked(9);
    writeFilter(model,zip);
    zip.close();
    arg0.worked(10);
  }
 catch (  final Exception e) {
    error=e;
    arg0.done();
    return;
  }
  arg0.worked(100);
  arg0.done();
}

Fixed version (ground truth):
@Override public void run(final IProgressMonitor arg0) throws InvocationTargetException, InterruptedException {
  arg0.beginTask(Resources.getMessage("String_Node_Str"),10);
  try {
    final FileOutputStream f=new FileOutputStream(path);
    final ZipOutputStream zip=new ZipOutputStream(new BufferedOutputStream(f));
    writeMetadata(model,zip);
    arg0.worked(1);
    writeModel(model,zip);
    arg0.worked(2);
    writeInput(model,zip);
    arg0.worked(4);
    writeOutput(model,zip);
    arg0.worked(5);
    writeOutputSubset(model,zip);
    arg0.worked(6);
    writeConfiguration(model,zip);
    arg0.worked(7);
    final Map<String,Integer> map=writeLattice(model,zip);
    arg0.worked(8);
    writeClipboard(model,map,zip);
    arg0.worked(9);
    writeFilter(model,zip);
    zip.close();
    arg0.worked(10);
  }
 catch (  final Exception e) {
    error=e;
    arg0.done();
    return;
  }
  arg0.worked(100);
  arg0.done();
}
Program: 108932
Project: 108932
Buggy source:
/** 
 * Returns the respective data handle
 * @return
 */
private DataHandle getData(){
  ModelConfiguration config=model.getOutputConfig();
  if (config == null) {
    config=model.getInputConfig();
  }
  DataHandle data;
  if (target == ModelPart.INPUT) {
    data=config.getInput().getHandle();
  }
 else {
    data=model.getOutput();
  }
  if (data != null && model.getViewConfig().isSubset()) {
    data=data.getView();
  }
  if ((config == null) || (data == null)) {
    return null;
  }
 else {
    return data;
  }
}

Fixed version (ground truth):
/** 
 * Returns the respective data handle
 * @return
 */
private DataHandle getData(){
  ModelConfiguration config=model.getOutputConfig();
  if (config == null) {
    config=model.getInputConfig();
  }
  DataHandle data=getHandle();
  if ((config == null) || (data == null)) {
    return null;
  }
 else {
    return data;
  }
}
Program: 108935
Project: 108935
Buggy source:
@Override public void reset(){
  sliderL.setSelection(0);
  sliderC.setSelection(0);
  labelC.setText("String_Node_Str");
  labelL.setText("String_Node_Str");
  comboVariant.select(0);
  super.reset();
}

Fixed version (ground truth):
@Override public void reset(){
  sliderL.setSelection(0);
  sliderC.setSelection(0);
  sliderC.setEnabled(false);
  labelC.setText("String_Node_Str");
  labelL.setText("String_Node_Str");
  comboVariant.select(0);
  super.reset();
}
Program: 108936
Project: 108936
Buggy source:
@Override protected void parse(){
  ModelLDiversityCriterion m=model.getLDiversityModel().get(attribute);
  if (m == null) {
    reset();
    return;
  }
  root.setRedraw(false);
  labelC.setText(String.valueOf(m.getC()));
  labelL.setText(String.valueOf(m.getL()));
  sliderL.setSelection(intToSlider(2,100,m.getL()));
  sliderC.setSelection(doubleToSlider(0.001d,100d,m.getC()));
  comboVariant.select(m.getVariant());
  if (m.isActive() && m.isEnabled()) {
    SWTUtil.enable(root);
  }
 else {
    SWTUtil.disable(root);
  }
  root.setRedraw(true);
}

Fixed version (ground truth):
@Override protected void parse(){
  ModelLDiversityCriterion m=model.getLDiversityModel().get(attribute);
  if (m == null) {
    reset();
    return;
  }
  root.setRedraw(false);
  labelC.setText(String.valueOf(m.getC()));
  labelL.setText(String.valueOf(m.getL()));
  sliderL.setSelection(intToSlider(2,100,m.getL()));
  sliderC.setSelection(doubleToSlider(0.001d,100d,m.getC()));
  comboVariant.select(m.getVariant());
  if (m.isActive() && m.isEnabled()) {
    SWTUtil.enable(root);
  }
 else {
    SWTUtil.disable(root);
  }
  if (m.getVariant() == 2) {
    sliderC.setEnabled(true);
  }
 else {
    sliderC.setEnabled(false);
  }
  root.setRedraw(true);
}
Program: 108937
Project: 108937
Buggy source:
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.HIERARCHY) {
    if (attribute.equals(model.getSelectedAttribute())) {
      setHierarchy((Hierarchy)event.data);
      base.setEnabled(true);
      base.redraw();
    }
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
  }
 else   if (event.part == ModelPart.INPUT) {
    final DataDefinition d=model.getInputConfig().getInput().getDefinition();
    final AttributeType type=d.getAttributeType(attribute);
    if (type instanceof Hierarchy) {
      setHierarchy((Hierarchy)type);
      base.setEnabled(true);
      base.redraw();
    }
 else     if ((type == AttributeType.SENSITIVE_ATTRIBUTE) && (model.getInputConfig().getHierarchy(model.getSelectedAttribute()) != null)) {
      setHierarchy(model.getInputConfig().getHierarchy(model.getSelectedAttribute()));
      base.setEnabled(true);
      base.redraw();
    }
 else {
      reset();
    }
  }
 else   if (event.part == ModelPart.ATTRIBUTE_TYPE) {
    if (event.data.equals(this.attribute)) {
      pushHierarchy();
    }
  }
}

Fixed version (ground truth):
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.HIERARCHY) {
    if (attribute.equals(model.getSelectedAttribute())) {
      setHierarchy((Hierarchy)event.data);
      base.setEnabled(true);
      base.redraw();
    }
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
  }
 else   if (event.part == ModelPart.INPUT) {
    final DataDefinition d=model.getInputConfig().getInput().getDefinition();
    final AttributeType type=d.getAttributeType(attribute);
    if (type instanceof Hierarchy) {
      setHierarchy((Hierarchy)type);
      base.setEnabled(true);
      base.redraw();
    }
 else     if ((type == AttributeType.SENSITIVE_ATTRIBUTE) && (model.getInputConfig().getHierarchy(attribute) != null)) {
      setHierarchy(model.getInputConfig().getHierarchy(attribute));
      base.setEnabled(true);
      base.redraw();
    }
 else {
      reset();
    }
  }
 else   if (event.part == ModelPart.ATTRIBUTE_TYPE) {
    if (event.data.equals(this.attribute)) {
      pushHierarchy();
    }
  }
}
Program: 108939
Project: 108939
Buggy source:
/** 
 * Writes the hierarchies to the file
 * @param zip
 * @throws IOException
 */
private void writeHierarchies(final ModelConfiguration config,final String prefix,final ZipOutputStream zip) throws IOException {
  if (config.getInput() != null) {
    if (config.getInput().getDefinition() != null) {
      for (      final String a : config.getInput().getDefinition().getQuasiIdentifyingAttributes()) {
        final String[][] h=config.getInput().getDefinition().getHierarchy(a);
        if (h != null) {
          zip.putNextEntry(new ZipEntry(prefix + "String_Node_Str" + toFileName(a)+ "String_Node_Str"));
          final CSVDataOutput out=new CSVDataOutput(zip,model.getSeparator());
          out.write(h);
        }
      }
    }
  }
  Set<String> additional=new HashSet<String>();
  for (  HierarchicalDistanceTCloseness c : config.getCriteria(HierarchicalDistanceTCloseness.class)) {
    additional.add(c.getAttribute());
  }
  for (  String attribute : additional) {
    Hierarchy h=config.getHierarchy(attribute);
    zip.putNextEntry(new ZipEntry(prefix + "String_Node_Str" + toFileName(attribute)+ "String_Node_Str"));
    final CSVDataOutput out=new CSVDataOutput(zip,model.getSeparator());
    out.write(h.getHierarchy());
  }
}

Fixed version (ground truth):
/** 
 * Writes the hierarchies to the file
 * @param zip
 * @throws IOException
 */
private void writeHierarchies(final ModelConfiguration config,final String prefix,final ZipOutputStream zip) throws IOException {
  Set<String> done=new HashSet<String>();
  if (config.getInput() != null) {
    if (config.getInput().getDefinition() != null) {
      for (      final String a : config.getInput().getDefinition().getQuasiIdentifyingAttributes()) {
        final String[][] h=config.getInput().getDefinition().getHierarchy(a);
        if (h != null) {
          zip.putNextEntry(new ZipEntry(prefix + "String_Node_Str" + toFileName(a)+ "String_Node_Str"));
          final CSVDataOutput out=new CSVDataOutput(zip,model.getSeparator());
          out.write(h);
          done.add(a);
        }
      }
    }
  }
  for (  Entry<String,Hierarchy> entry : config.getHierarchies().entrySet()) {
    final String[][] h=entry.getValue().getHierarchy();
    String a=entry.getKey();
    if (!done.contains(a)) {
      if (h != null) {
        zip.putNextEntry(new ZipEntry(prefix + "String_Node_Str" + toFileName(a)+ "String_Node_Str"));
        final CSVDataOutput out=new CSVDataOutput(zip,model.getSeparator());
        out.write(h);
      }
    }
  }
}
Program: 108940
Project: 108940
Buggy source:
/** 
 * Writes the data definition to the file
 * @param zip
 * @throws IOException
 */
private void writeDefinition(final ModelConfiguration config,final String prefix,final ZipOutputStream zip) throws IOException {
  if (config.getInput() != null) {
    if (config.getInput().getDefinition() != null) {
      zip.putNextEntry(new ZipEntry(prefix + "String_Node_Str"));
      final Writer w=new OutputStreamWriter(zip);
      w.write(toXML(config.getInput().getHandle(),config.getInput().getDefinition()));
      w.flush();
    }
  }
}

Fixed version (ground truth):
/** 
 * Writes the data definition to the file
 * @param zip
 * @throws IOException
 */
private void writeDefinition(final ModelConfiguration config,final String prefix,final ZipOutputStream zip) throws IOException {
  if (config.getInput() != null) {
    if (config.getInput().getDefinition() != null) {
      zip.putNextEntry(new ZipEntry(prefix + "String_Node_Str"));
      final Writer w=new OutputStreamWriter(zip);
      w.write(toXML(config,config.getInput().getHandle(),config.getInput().getDefinition()));
      w.flush();
    }
  }
}
Program: 108941
Project: 108941
Buggy source:
/** 
 * Sort
 * @param handle
 * @param swapper
 * @param from
 * @param to
 * @param ascending
 * @param columns
 */
private void sortSubset(final DataHandleSubset handle,final Swapper swapper,final int from,final int to,final boolean ascending,final int... columns){
  final DataHandleSubset outer=handle;
  final IntComparator c=new IntComparator(){
    @Override public int compare(    final int arg0,    final int arg1){
      return outer.internalCompare(arg0,arg1,columns,ascending);
    }
  }
;
  final Swapper s=new Swapper(){
    @Override public void swap(    final int arg0,    final int arg1){
      if (input != null)       input.internalSwap(outer.internalTranslate(arg0),outer.internalTranslate(arg1));
      if (output != null)       output.internalSwap(outer.internalTranslate(arg0),outer.internalTranslate(arg1));
      if (swapper != null)       swapper.swap(arg0,arg1);
    }
  }
;
  GenericSorting.mergeSort(from,to,c,s);
}

Fixed version (ground truth):
/** 
 * Sort
 * @param handle
 * @param swapper
 * @param from
 * @param to
 * @param ascending
 * @param columns
 */
private void sortSubset(final DataHandleSubset handle,final Swapper swapper,final int from,final int to,final boolean ascending,final int... columns){
  final DataHandleSubset outer=handle;
  final IntComparator c=new IntComparator(){
    @Override public int compare(    final int arg0,    final int arg1){
      return outer.internalCompare(arg0,arg1,columns,ascending);
    }
  }
;
  final Swapper s=new Swapper(){
    @Override public void swap(    final int arg0,    final int arg1){
      if (input != null)       input.internalSwap(outer.internalTranslate(arg0),outer.internalTranslate(arg1));
      if (output != null)       output.internalSwap(outer.internalTranslate(arg0),outer.internalTranslate(arg1));
      if (swapper != null)       swapper.swap(outer.internalTranslate(arg0),outer.internalTranslate(arg1));
    }
  }
;
  GenericSorting.mergeSort(from,to,c,s);
}
Program: 108942
Project: 108942
Buggy source:
/** 
 * Rebuild array representation of subset
 */
protected void internalRebuild(){
  int index=0;
  for (int i=0; i < subset.getArray().length; i++) {
    if (this.subset.getSet().contains(i)) {
      this.subset.getArray()[index++]=i;
    }
  }
}

Fixed version (ground truth):
/** 
 * Rebuild array representation of subset
 */
protected void internalRebuild(){
  int index=0;
  for (int i=0; i < subset.getSet().length(); i++) {
    if (this.subset.getSet().contains(i)) {
      this.subset.getArray()[index++]=i;
    }
  }
}
Program: 108943
Project: 108943
Buggy source:
/** 
 * Reset a previous lattice and run the algorithm 
 * @param handle
 * @param definition
 * @param config
 * @param lattice
 * @param algorithm
 * @return
 * @throws IOException
 */
protected Result anonymizeInternal(final DataHandle handle,final DataDefinition definition,final ARXConfiguration config,Lattice lattice,int multiplier,AbstractAlgorithm algorithm) throws IOException {
  final DataManager manager=prepareDataManager(handle,definition,config);
  config.initialize(manager);
  checkAfterEncoding(config,manager);
  if (lattice == null) {
    lattice=new LatticeBuilder(manager.getMaxLevels(),manager.getMinLevels(),manager.getHierachyHeights()).build();
  }
  lattice.setListener(listener);
  lattice.setMultiplier(multiplier);
  final INodeChecker checker=new NodeChecker(manager,config.getMetric(),config,historySize,snapshotSizeDataset,snapshotSizeSnapshot);
  config.getMetric().initialize(manager.getDataQI(),manager.getHierarchies(),config);
  if (algorithm != null) {
    algorithm=FLASHAlgorithm.create((AbstractFLASHAlgorithm)algorithm,checker);
  }
 else {
    algorithm=FLASHAlgorithm.create(lattice,checker,new FLASHStrategy(lattice,manager.getHierarchies()));
  }
  algorithm.traverse();
  return new Result(config.getMetric(),checker,lattice,manager,algorithm);
}

Fixed version (ground truth):
/** 
 * Reset a previous lattice and run the algorithm 
 * @param handle
 * @param definition
 * @param config
 * @param lattice
 * @param algorithm
 * @return
 * @throws IOException
 */
protected Result anonymizeInternal(final DataHandle handle,final DataDefinition definition,final ARXConfiguration config,Lattice lattice,int multiplier,AbstractAlgorithm algorithm) throws IOException {
  final DataManager manager=prepareDataManager(handle,definition,config);
  config.initialize(manager);
  checkAfterEncoding(config,manager);
  if (lattice == null) {
    lattice=new LatticeBuilder(manager.getMaxLevels(),manager.getMinLevels(),manager.getHierachyHeights()).build();
  }
  lattice.setListener(listener);
  lattice.setMultiplier(multiplier);
  final INodeChecker checker=new NodeChecker(manager,config.getMetric(),config,historySize,snapshotSizeDataset,snapshotSizeSnapshot);
  config.getMetric().initialize(manager.getDataQI(),manager.getHierarchies(),config);
  if (algorithm != null) {
    algorithm=FLASHAlgorithm.create((AbstractFLASHAlgorithm)algorithm,checker);
  }
 else {
    algorithm=FLASHAlgorithm.create(lattice,checker,new FLASHStrategy(lattice,manager.getHierarchies()));
  }
  algorithm.traverse();
  checker.getHistory().reset();
  checker.getHistory().setSize(0);
  return new Result(config.getMetric(),checker,lattice,manager,algorithm);
}
Program: 108945
Project: 108945
Buggy source:
/** 
 * Stores a snapshot.
 * @param node the node
 * @param g the g
 */
public boolean store(final Node node,final IHashGroupify g,final int[] usedSnapshot){
  if ((node.isAnonymous() || (g.size() > snapshotSizeDataset) || canPrune(node))) {
    return false;
  }
  if (usedSnapshot != null) {
    final double percentSize=(g.size() / ((double)usedSnapshot.length / config.getSnapshotLength()));
    if (percentSize > snapshotSizeSnapshot) {
      return false;
    }
  }
  final int[] data=createSnapshot(g);
  if (cache.size() >= maxSize) {
    purgeCache();
  }
  nodeToSnapshot.put(node,data);
  cache.append(node);
  return true;
}

Fixed version (ground truth):
/** 
 * Stores a snapshot.
 * @param node the node
 * @param g the g
 */
public boolean store(final Node node,final IHashGroupify g,final int[] usedSnapshot){
  if ((node.isAnonymous() || (g.size() > snapshotSizeDataset) || canPrune(node))) {
    return false;
  }
  if (usedSnapshot != null) {
    final double percentSize=(g.size() / ((double)usedSnapshot.length / config.getSnapshotLength()));
    if (percentSize > snapshotSizeSnapshot) {
      return false;
    }
  }
  final int[] data=createSnapshot(g);
  if (cache.size() >= size) {
    purgeCache();
  }
  nodeToSnapshot.put(node,data);
  cache.append(node);
  return true;
}
Program: 108946
Project: 108946
Buggy source:
/** 
 * Creates a new history.
 * @param rowCount the row count
 * @param maxSize the max size
 * @param snapshotSizeDataset the snapshotSizeDataset
 */
public History(final int rowCount,final int maxSize,final double snapshotSizeDataset,final double snapshotSizeSnapshot,final ARXConfiguration config,final IntArrayDictionary dictionarySensValue,final IntArrayDictionary dictionarySensFreq){
  this.snapshotSizeDataset=(long)(rowCount * snapshotSizeDataset);
  this.snapshotSizeSnapshot=snapshotSizeSnapshot;
  cache=new MRUCache<Node>(maxSize);
  nodeToSnapshot=new HashMap<Node,int[]>(maxSize);
  this.maxSize=maxSize;
  this.dictionarySensFreq=dictionarySensFreq;
  this.dictionarySensValue=dictionarySensValue;
  this.config=config;
  requirements=config.getRequirements();
}

Fixed version (ground truth):
/** 
 * Creates a new history.
 * @param rowCount the row count
 * @param size the max size
 * @param snapshotSizeDataset the snapshotSizeDataset
 */
public History(final int rowCount,final int size,final double snapshotSizeDataset,final double snapshotSizeSnapshot,final ARXConfiguration config,final IntArrayDictionary dictionarySensValue,final IntArrayDictionary dictionarySensFreq){
  this.snapshotSizeDataset=(long)(rowCount * snapshotSizeDataset);
  this.snapshotSizeSnapshot=snapshotSizeSnapshot;
  this.cache=new MRUCache<Node>(size);
  this.nodeToSnapshot=new HashMap<Node,int[]>(size);
  this.size=size;
  this.dictionarySensFreq=dictionarySensFreq;
  this.dictionarySensValue=dictionarySensValue;
  this.config=config;
  this.requirements=config.getRequirements();
}
Program: 108947
Project: 108947
Buggy source:
/** 
 * Clears the history.
 */
public void reset(){
  cache.clear();
  nodeToSnapshot.clear();
}

Fixed version (ground truth):
/** 
 * Clears the history.
 */
public void reset(){
  this.cache.clear();
  this.nodeToSnapshot.clear();
  this.dictionarySensFreq.clear();
  this.dictionarySensValue.clear();
  this.resultNode=null;
}
Program: 108948
Project: 108948
Buggy source:
/** 
 * Sorts the data
 * @param input
 */
public void actionDataSort(boolean input){
  if (model.getOutput() == null)   return;
  if (model.getSelectedAttribute() == null)   return;
  if (input) {
    this.model.getViewConfig().setMode(Mode.SORTED_INPUT);
  }
 else {
    this.model.getViewConfig().setMode(Mode.SORTED_OUTPUT);
  }
  this.model.getViewConfig().setAttribute(model.getSelectedAttribute());
  this.updateViewConfig(false);
  this.update(new ModelEvent(this,ModelPart.VIEW_CONFIG,model.getOutput()));
}

Fixed version (ground truth):
/** 
 * Sorts the data
 * @param input
 */
public void actionDataSort(boolean input){
  if (model.getSelectedAttribute() == null)   return;
  if (input) {
    this.model.getViewConfig().setMode(Mode.SORTED_INPUT);
  }
 else {
    this.model.getViewConfig().setMode(Mode.SORTED_OUTPUT);
  }
  this.model.getViewConfig().setAttribute(model.getSelectedAttribute());
  this.updateViewConfig(false);
  this.update(new ModelEvent(this,ModelPart.VIEW_CONFIG,model.getOutput()));
}