nus-yam/ex-repair huggingface dataset:
Program: 108159
Project: 108159
Buggy source:
/** 
 * Returns a checkbox table viewer. Implements hacks for fixing OSX bugs.
 * @param parent
 * @param style
 * @return
 */
public static CheckboxTableViewer createTableViewerCheckbox(Composite container,int style){
  return CheckboxTableViewer.newCheckList(container,getTableStyle(style));
}

Fixed version (ground truth):
/** 
 * Returns a checkbox table viewer. Implements hacks for fixing OSX bugs.
 * @param parent
 * @param style
 * @return
 */
public static CheckboxTableViewer createTableViewerCheckbox(Composite container,int style){
  CheckboxTableViewer viewer=CheckboxTableViewer.newCheckList(container,style);
  fixOSXTableBug(viewer.getTable());
  return viewer;
}
Program: 108160
Project: 108160
Buggy source:
/** 
 * Returns a table viewer. Implements hacks for fixing OSX bugs.
 * @param parent
 * @param style
 * @return
 */
public static TableViewer createTableViewer(Composite container,int style){
  return new TableViewer(container,getTableStyle(style));
}

Fixed version (ground truth):
/** 
 * Returns a table viewer. Implements hacks for fixing OSX bugs.
 * @param parent
 * @param style
 * @return
 */
public static TableViewer createTableViewer(Composite container,int style){
  TableViewer viewer=new TableViewer(container,style);
  fixOSXTableBug(viewer.getTable());
  return viewer;
}
Program: 108161
Project: 108161
Buggy source:
/** 
 * Returns a dynamic table. Implements hacks for fixing OSX bugs.
 * @param parent
 * @param style
 * @return
 */
public static DynamicTable createTableDynamic(Composite parent,int style){
  return new DynamicTable(parent,getTableStyle(style));
}

Fixed version (ground truth):
/** 
 * Returns a dynamic table. Implements hacks for fixing OSX bugs.
 * @param parent
 * @param style
 * @return
 */
public static DynamicTable createTableDynamic(Composite parent,int style){
  DynamicTable table=new DynamicTable(parent,style);
  fixOSXTableBug(table);
  return table;
}
Program: 108162
Project: 108162
Buggy source:
@Override protected DataHandle getHandle(){
  if (model != null) {
    DataHandle handle=model.getInputConfig().getInput().getHandle();
    if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null) {
      handle=handle.getView();
    }
    return handle;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override protected DataHandle getHandle(){
  if (model != null) {
    Data data=model.getInputConfig().getInput();
    if (data == null) {
      return null;
    }
    DataHandle handle=data.getHandle();
    if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null) {
      handle=handle.getView();
    }
    return handle;
  }
 else {
    return null;
  }
}
Program: 108163
Project: 108163
Buggy source:
/** 
 * Creates a new instance.
 * @param parent
 * @param controller
 */
public ViewProperties(final Composite parent,final Controller controller){
  controller.addListener(ModelPart.RESULT,this);
  controller.addListener(ModelPart.SELECTED_NODE,this);
  this.controller=controller;
  ComponentTitledBorder border=new ComponentTitledBorder(parent,controller,Resources.getMessage("String_Node_Str"),"String_Node_Str");
  root=new Composite(border.getControl(),SWT.NONE);
  border.setChild(root);
  border.setLayoutData(SWTUtil.createFillGridData());
  final GridLayout groupNodeGridLayout=new GridLayout();
  groupNodeGridLayout.numColumns=1;
  root.setLayout(groupNodeGridLayout);
  table=SWTUtil.createTable(parent,SWT.BORDER);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  final GridData gdata=SWTUtil.createFillGridData();
  table.setLayoutData(gdata);
  table.setMenu(new ClipboardHandlerTable(table).getMenu());
  TableColumn c=new TableColumn(table,SWT.NONE);
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new TableColumn(table,SWT.NONE);
  c.setText(Resources.getMessage("String_Node_Str"));
  SWTUtil.createGenericTooltip(table);
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  reset();
}

Fixed version (ground truth):
/** 
 * Creates a new instance.
 * @param parent
 * @param controller
 */
public ViewProperties(final Composite parent,final Controller controller){
  controller.addListener(ModelPart.RESULT,this);
  controller.addListener(ModelPart.SELECTED_NODE,this);
  this.controller=controller;
  ComponentTitledBorder border=new ComponentTitledBorder(parent,controller,Resources.getMessage("String_Node_Str"),"String_Node_Str");
  root=new Composite(border.getControl(),SWT.NONE);
  border.setChild(root);
  border.setLayoutData(SWTUtil.createFillGridData());
  final GridLayout groupNodeGridLayout=new GridLayout();
  groupNodeGridLayout.numColumns=1;
  root.setLayout(groupNodeGridLayout);
  table=SWTUtil.createTable(root,SWT.BORDER);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  final GridData gdata=SWTUtil.createFillGridData();
  table.setLayoutData(gdata);
  table.setMenu(new ClipboardHandlerTable(table).getMenu());
  TableColumn c=new TableColumn(table,SWT.NONE);
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new TableColumn(table,SWT.NONE);
  c.setText(Resources.getMessage("String_Node_Str"));
  SWTUtil.createGenericTooltip(table);
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  reset();
}
Program: 108164
Project: 108164
Buggy source:
/** 
 * Returns a list of matching data types
 * @param column
 */
public List<Pair<DataType<?>,Double>> getMatchingDataTypes(ImportWizardModelColumn column){
  if (wizardColumns.indexOf(column) == -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Data data=Data.create(getPreviewData());
  int columnIndex=((ImportColumnIndexed)column.getColumn()).getIndex();
  return data.getHandle().getMatchingDataTypes(columnIndex,locale,Math.ulp(0d));
}

Fixed version (ground truth):
/** 
 * Returns a list of matching data types
 * @param column
 */
public List<Pair<DataType<?>,Double>> getMatchingDataTypes(ImportWizardModelColumn column){
  if (wizardColumns.indexOf(column) == -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Data data=Data.create(getPreviewData());
  int columnIndex=-1;
  ImportColumn c=column.getColumn();
  if (c instanceof ImportColumnIndexed) {
    columnIndex=((ImportColumnIndexed)column.getColumn()).getIndex();
  }
 else   if (column.getColumn() instanceof ImportColumnJDBC) {
    columnIndex=((ImportColumnJDBC)column.getColumn()).getIndex();
  }
  return data.getHandle().getMatchingDataTypes(columnIndex,locale,Math.ulp(0d));
}
Program: 108167
Project: 108167
Buggy source:
public Pair<Vector2D,SquareMatrix2D> evaluate(Vector2D input){
  Vector2D object=new Vector2D();
  SquareMatrix2D derivatives=new SquareMatrix2D();
  double t=input.x;
  double a=input.y;
  double val0=u - 1d;
  double val1=Gamma.digamma(val0 + (t / a) + 1d);
  double val2=Gamma.trigamma((a + t + (a * val0)) / a);
  double val3=Gamma.trigamma((t / a) + 1d);
  double val4=Gamma.digamma((t / a) + 1);
  double val5=a * a;
  double d1=(val3 - val2) / (val5);
  double d2=(((a * val1) + (t * val2)) - (a * val4) - (t * val3)) / (val5 * a);
  double d3=(((((val5 * val0) - (t * t * val2)) + (t * t * val3)) - (2 * a * t* val1)) + (2 * a * t* val4)) / (val5 * val5);
  double o2=(val1 - val4) / a;
  double o3=((-t * val1) + (a * val0) + (t * val4)) / (a * a);
  double o4=Gamma.digamma(n + t) - Gamma.digamma(t + 1d);
  checkInterrupt();
  double d4=0;
  double d5=0;
  double o1=0;
  double val6=Gamma.digamma(1d - a);
  double val7=Gamma.trigamma(1d - a);
  for (int i=0; i < classes.length; i+=2) {
    int key=classes[i];
    int value=classes[i + 1];
    double val8=t + key;
    d4+=1d / (val8 * val8);
    d5+=key != 1 ? value * (val7 - Gamma.trigamma(key - a)) : 0;
    o1+=key == 1 ? 0 : value * (Gamma.digamma(key - a) - val6);
    checkInterrupt();
  }
  derivatives.x1=d4 - d1;
  derivatives.x2=0 - d2;
  derivatives.y1=0 - d2;
  derivatives.y2=0 - d3 - d5;
  object.x=o2 - o4;
  object.y=o3 - o1;
  return new Pair<Vector2D,SquareMatrix2D>(object,derivatives);
}

Fixed version (ground truth):
public Pair<Vector2D,SquareMatrix2D> evaluate(Vector2D input){
  Vector2D object=new Vector2D();
  SquareMatrix2D derivatives=new SquareMatrix2D();
  double t=input.x;
  double a=input.y;
  double val0=u - 1d;
  double val1=Gamma.digamma(val0 + (t / a) + 1d);
  double val2=Gamma.trigamma((a + t + (a * val0)) / a);
  double val3=Gamma.trigamma((t / a) + 1d);
  double val4=Gamma.digamma((t / a) + 1d);
  double val5=a * a;
  double d1=(val3 - val2) / (val5);
  double d5=(((a * val1) + (t * val2)) - (a * val4) - (t * val3)) / (val5 * a);
  double d3=(((((val5 * val0) - (t * t * val2)) + (t * t * val3)) - (2d * a * t* val1)) + (2d * a * t* val4)) / (val5 * val5);
  double o1=(val1 - val4) / a;
  double o3=((-t * val1) + (a * val0) + (t * val4)) / (a * a);
  double o2=Gamma.digamma(n + t) - Gamma.digamma(t + 1d);
  checkInterrupt();
  double d2=Gamma.trigamma(t + 1d) - Gamma.trigamma(n + t);
  double d4=0;
  double o4=0;
  double val6=Gamma.digamma(1d - a);
  double val7=Gamma.trigamma(1d - a);
  for (int i=0; i < classes.length; i+=2) {
    int key=classes[i];
    int value=classes[i + 1];
    if (key != 1) {
      d4+=value * (val7 - Gamma.trigamma(key - a));
      o4+=value * (Gamma.digamma(key - a) - val6);
    }
    checkInterrupt();
  }
  derivatives.x1=d2 - d1;
  derivatives.x2=0d - d5;
  derivatives.y1=0d - d5;
  derivatives.y2=0d - d3 - d4;
  object.x=o1 - o2;
  object.y=o3 - o4;
  return new Pair<Vector2D,SquareMatrix2D>(object,derivatives);
}
Program: 108168
Project: 108168
Buggy source:
/** 
 * Compiles the result of the Newton-Rhapson-Algorithm
 * @return
 */
private double getResult(Vector2D result,double p){
  double t=result.x;
  double a=result.y;
  if (Double.isNaN(a) && Double.isNaN(t) && a == 0) {
    return Double.NaN;
  }
  double val1=Double.NaN;
  try {
    val1=Math.exp(Gamma.logGamma(t + 1) - Gamma.logGamma(t + a)) * Math.pow(p,a);
  }
 catch (  Exception e) {
  }
  val1=val1 >= 0d && val1 <= p ? val1 : Double.NaN;
  double val2=Double.NaN;
  try {
    val2=(Gamma.gamma(t + 1) / Gamma.gamma(t + a)) * Math.pow(p,a);
  }
 catch (  Exception e) {
  }
  val2=val2 >= 0d && val2 <= p ? val2 : Double.NaN;
  if (Double.isNaN(val1) && Double.isNaN(val2)) {
    return Double.NaN;
  }
 else   if (!Double.isNaN(val1) && !Double.isNaN(val2)) {
    return Math.max(val1,val2);
  }
 else   if (Double.isNaN(val1)) {
    return val2;
  }
 else {
    return val1;
  }
}

Fixed version (ground truth):
/** 
 * Compiles the result of the Newton-Rhapson-Algorithm
 * @return
 */
private double getResult(Vector2D result,double p){
  double t=result.x;
  double a=result.y;
  if (Double.isNaN(a) || Double.isNaN(t) || a == 0) {
    return Double.NaN;
  }
  double val1=Double.NaN;
  try {
    val1=Math.exp(Gamma.logGamma(t + 1) - Gamma.logGamma(t + a)) * Math.pow(p,a);
  }
 catch (  Exception e) {
  }
  val1=val1 >= 0d && val1 <= p ? val1 : Double.NaN;
  double val2=Double.NaN;
  try {
    val2=(Gamma.gamma(t + 1) / Gamma.gamma(t + a)) * Math.pow(p,a);
  }
 catch (  Exception e) {
  }
  val2=val2 >= 0d && val2 <= p ? val2 : Double.NaN;
  if (Double.isNaN(val1) && Double.isNaN(val2)) {
    return Double.NaN;
  }
 else   if (!Double.isNaN(val1) && !Double.isNaN(val2)) {
    return Math.max(val1,val2);
  }
 else   if (Double.isNaN(val1)) {
    return val2;
  }
 else {
    return val1;
  }
}
Program: 108169
Project: 108169
Buggy source:
/** 
 * Constructor
 * @param handle
 * @param row
 */
private TupleWrapper(DataHandle handle,int[] indices,int row){
  this.handle=handle;
  this.row=row;
  this.indices=indices;
  int result=1;
  for (  int index : indices) {
    result=31 * result + handle.getValue(row,index).hashCode();
  }
  this.hashCode=result;
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param handle
 * @param row
 */
private TupleWrapper(DataHandle handle,int[] indices,int row){
  this.values=new String[indices.length];
  int hashcode=1;
  int idx=0;
  for (  int index : indices) {
    String value=handle.getValue(row,index);
    hashcode=31 * hashcode + value.hashCode();
    values[idx++]=value;
  }
  this.hashcode=hashcode;
}
Program: 108170
Project: 108170
Buggy source:
@Override public int hashCode(){
  return hashCode;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return hashcode;
}
Program: 108171
Project: 108171
Buggy source:
@Override public boolean equals(Object obj){
  TupleWrapper other=(TupleWrapper)obj;
  for (int i=0; i < indices.length; i++) {
    if (handle.getValue(this.row,i) != handle.getValue(other.row,i)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  return Arrays.equals(((TupleWrapper)other).values,this.values);
}
Program: 108172
Project: 108172
Buggy source:
@Override public void enforce(final HashGroupifyDistribution distribution,final int numMaxSuppressedOutliers){
  distribution.suppressWhileNotFulfilledBinary(new PrivacyCondition(){
    public State isFulfilled(    HashGroupifyDistribution distribution){
      boolean fulfilled=RiskBasedPrivacyCriterion.this.isFulfilled(distribution);
      if (!fulfilled && distribution.getNumOfSuppressedTuples() > numMaxSuppressedOutliers) {
        return State.ABORT;
      }
 else {
        return fulfilled ? State.FULFILLED : State.NOT_FULFILLED;
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void enforce(final HashGroupifyDistribution distribution,final int numMaxSuppressedOutliers){
  if (RiskBasedPrivacyCriterion.this.isFulfilled(distribution)) {
    return;
  }
  distribution.suppressWhileNotFulfilledBinary(new PrivacyCondition(){
    public State isFulfilled(    HashGroupifyDistribution distribution){
      boolean fulfilled=RiskBasedPrivacyCriterion.this.isFulfilled(distribution);
      if (!fulfilled && distribution.getNumOfSuppressedTuples() > numMaxSuppressedOutliers) {
        return State.ABORT;
      }
 else {
        return fulfilled ? State.FULFILLED : State.NOT_FULFILLED;
      }
    }
  }
);
}
Program: 108173
Project: 108173
Buggy source:
/** 
 * Returns the current context, consisting of a consistent combination of a configuration and a data handle.
 * @return
 */
public AnalysisData getData(){
  DataHandle handle=null;
  ModelConfiguration config=null;
  DataDefinition definition=null;
  if (model == null)   return null;
  if (target == ModelPart.INPUT) {
    if (model.getOutputConfig() != null && model.getOutputConfig().getInput() != null) {
      config=model.getOutputConfig();
      definition=model.getOutputDefinition();
    }
 else {
      config=model.getInputConfig();
      definition=model.getInputDefinition();
    }
    if (config.getInput() == null)     return null;
    handle=config.getInput().getHandle();
  }
 else {
    definition=model.getOutputDefinition();
    config=model.getOutputConfig();
    handle=model.getOutput();
  }
  if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
    handle=handle.getView();
  }
  return new AnalysisData(config,handle,definition);
}

Fixed version (ground truth):
/** 
 * Returns the current context, consisting of a consistent combination of a configuration and a data handle.
 * @return
 */
public AnalysisData getData(){
  DataHandle handle=null;
  ModelConfiguration config=null;
  DataDefinition definition=null;
  if (model == null)   return null;
  if (target == ModelPart.INPUT) {
    if (model.getOutputConfig() != null && model.getOutputConfig().getInput() != null && model.getOutput() != null) {
      System.out.println("String_Node_Str");
      config=model.getOutputConfig();
      definition=model.getOutputDefinition();
    }
 else {
      System.out.println("String_Node_Str");
      config=model.getInputConfig();
      definition=model.getInputDefinition();
    }
    if (config.getInput() == null)     return null;
    handle=config.getInput().getHandle();
  }
 else {
    definition=model.getOutputDefinition();
    config=model.getOutputConfig();
    handle=model.getOutput();
  }
  if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
    handle=handle.getView();
  }
  return new AnalysisData(config,handle,definition);
}
Program: 108174
Project: 108174
Buggy source:
@Override public void stop(){
  builder.interrupt();
  this.stopped=true;
}

Fixed version (ground truth):
@Override public void stop(){
  if (builder != null)   builder.interrupt();
  this.stopped=true;
}
Program: 108176
Project: 108176
Buggy source:
@Override public void stop(){
  builder.interrupt();
  this.stopped=true;
}

Fixed version (ground truth):
@Override public void stop(){
  if (builder != null)   builder.interrupt();
  this.stopped=true;
}
Program: 108178
Project: 108178
Buggy source:
@Override public void stop(){
  builder.interrupt();
  this.stopped=true;
}

Fixed version (ground truth):
@Override public void stop(){
  if (builder != null)   builder.interrupt();
  this.stopped=true;
}
Program: 108180
Project: 108180
Buggy source:
@Override public void stop(){
  builder.interrupt();
  this.stopped=true;
}

Fixed version (ground truth):
@Override public void stop(){
  if (builder != null)   builder.interrupt();
  this.stopped=true;
}
Program: 108182
Project: 108182
Buggy source:
@Override public void stop(){
  builder.interrupt();
  this.stopped=true;
}

Fixed version (ground truth):
@Override public void stop(){
  if (baseBuilder != null)   baseBuilder.interrupt();
  this.stopped=true;
}
Program: 108184
Project: 108184
Buggy source:
@Override public void run() throws InterruptedException {
  long time=System.currentTimeMillis();
switch (getModel().getRiskModel().getRiskModelForAttributes()) {
case SAMPLE_UNIQUENESS:
    risks=builder.getPopulationBasedAttributeRisks();
  break;
case POPULATION_UNIQUENESS_PITMAN:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.PITMAN);
break;
case POPULATION_UNIQUENESS_ZAYATZ:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.ZAYATZ);
break;
case POPULATION_UNIQUENESS_SNB:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.SNB);
break;
case POPULATION_UNIQUENESS_DANKAR:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.DANKAR);
break;
default :
throw new RuntimeException("String_Node_Str");
}
while (System.currentTimeMillis() - time < MINIMAL_WORKING_TIME && !stopped) {
Thread.sleep(10);
}
}

Fixed version (ground truth):
@Override public void run() throws InterruptedException {
  long time=System.currentTimeMillis();
switch (getModel().getRiskModel().getRiskModelForAttributes()) {
case SAMPLE_UNIQUENESS:
    risks=builder.getSampleBasedAttributeRisks();
  break;
case POPULATION_UNIQUENESS_PITMAN:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.PITMAN);
break;
case POPULATION_UNIQUENESS_ZAYATZ:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.ZAYATZ);
break;
case POPULATION_UNIQUENESS_SNB:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.SNB);
break;
case POPULATION_UNIQUENESS_DANKAR:
risks=builder.getPopulationBasedAttributeRisks(StatisticalPopulationModel.DANKAR);
break;
default :
throw new RuntimeException("String_Node_Str");
}
while (System.currentTimeMillis() - time < MINIMAL_WORKING_TIME && !stopped) {
Thread.sleep(10);
}
}
Program: 108186
Project: 108186
Buggy source:
/** 
 * We currently assume that at any time, at least one statistical model converges. This might not be the case, and 0 may be returned instead. That's why we only accept estimates of 0, if the number of equivalence classes of size 1 in the sample is also zero
 * @param distribution
 * @return
 */
protected boolean isFulfilled(HashGroupifyDistribution distribution){
  RiskModelPopulationBasedUniquenessRisk riskModel=new RiskModelPopulationBasedUniquenessRisk(this.populationModel,distribution.getEquivalenceClasses(),distribution.getNumberOfTuples());
  double populationUniques=riskModel.getFractionOfUniqueTuples(this.statisticalModel);
  if (populationUniques > 0d && populationUniques < getRiskThreshold()) {
    return true;
  }
 else   if (populationUniques == 0d && distribution.getFractionOfTuplesInClassesOfSize(1) == 0d) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * We currently assume that at any time, at least one statistical model converges. This might not be the case, and 0 may be returned instead. That's why we only accept estimates of 0, if the number of equivalence classes of size 1 in the sample is also zero
 * @param distribution
 * @return
 */
protected boolean isFulfilled(HashGroupifyDistribution distribution){
  RiskModelPopulationBasedUniquenessRisk riskModel=new RiskModelPopulationBasedUniquenessRisk(this.populationModel,distribution.getEquivalenceClasses(),distribution.getNumberOfTuples());
  double populationUniques=riskModel.getFractionOfUniqueTuples(this.statisticalModel);
  if (populationUniques > 0d && populationUniques <= getRiskThreshold()) {
    return true;
  }
 else   if (populationUniques == 0d && distribution.getFractionOfTuplesInClassesOfSize(1) == 0d) {
    return true;
  }
 else {
    return false;
  }
}
Program: 108188
Project: 108188
Buggy source:
/** 
 * Returns the vector of solutions obtained by the Newton-Raphson algorithm.
 * @param initialValue The vector of initial values.
 * @return the vector of solutions.
 * @exception IllegalArgumentException the first derivative matrix of the object functions is singular.
 */
protected double[] getSolution(final double[] initialValue){
  solutionVector=new Matrix(initialValue,initialValue.length);
  differenceVector=new Matrix(initialValue.length,1,100);
  firstDerivativeMatrix=new Matrix(initialValue.length,initialValue.length);
  int iterations=0;
  while (true) {
    checkInterrupt();
    firstDerivativeMatrix=new Matrix(firstDerivativeMatrix(solutionVector.getColumnPackedCopy()));
    double det=firstDerivativeMatrix.det();
    if (!Double.isNaN(det) && det != 0d) {
      differenceVector=firstDerivativeMatrix.inverse().times(new Matrix(objectFunctionVector(solutionVector.getColumnPackedCopy()),initialValue.length));
      solutionVector=solutionVector.minus(differenceVector);
    }
 else {
      return new double[]{Double.NaN,Double.NaN};
    }
    double normF=differenceVector.normF();
    if (Double.isNaN(normF) || normF <= accuracy || iterations++ > maxIterations) {
      break;
    }
  }
  return solutionVector.getColumnPackedCopy();
}

Fixed version (ground truth):
/** 
 * Returns the vector of solutions obtained by the Newton-Raphson algorithm.
 * @param initialValue The vector of initial values.
 * @return the vector of solutions.
 * @exception IllegalArgumentException the first derivative matrix of the object functions is singular.
 */
protected double[] getSolution(final double[] initialValue){
  solutionVector=new Matrix(initialValue,initialValue.length);
  differenceVector=new Matrix(initialValue.length,1,100);
  firstDerivativeMatrix=new Matrix(initialValue.length,initialValue.length);
  int iterations=0;
  while (true) {
    checkInterrupt();
    firstDerivativeMatrix=new Matrix(firstDerivativeMatrix(solutionVector.getColumnPackedCopy()));
    double det=firstDerivativeMatrix.det();
    if (!Double.isNaN(det) && det != 0d) {
      differenceVector=firstDerivativeMatrix.inverse().times(new Matrix(objectFunctionVector(solutionVector.getColumnPackedCopy()),initialValue.length));
      solutionVector=solutionVector.minus(differenceVector);
    }
 else {
      return new double[]{Double.NaN,Double.NaN};
    }
    double normF=differenceVector.normF();
    if (normF <= accuracy) {
      break;
    }
    if (Double.isNaN(normF) || iterations++ > maxIterations) {
      return new double[]{Double.NaN,Double.NaN};
    }
  }
  return solutionVector.getColumnPackedCopy();
}
Program: 108189
Project: 108189
Buggy source:
/** 
 * @return
 */
public abstract boolean isNull(String value);

Fixed version (ground truth):
/** 
 * Returns whether the given value represent null
 * @param value
 * @return
 */
public boolean isNull(String value){
  return value != null && value.length() == NULL_VALUE.length() && value.toUpperCase().equals(NULL_VALUE);
}
Program: 108190
Project: 108190
Buggy source:
/** 
 * Returns the next row The returned element is sorted as defined by   {@link ImportColumn#index} and contains as many elements as there are columns selected to importfrom  {@link #indexes}. The first row will always contain the names of the columns.   {@link #headerReturned} is used to keep track of that.
 * @return
 */
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  String[] result=new String[indexes.length];
  for (int i=0; i < indexes.length; i++) {
    result[i]=row[indexes[i]];
    if (!dataTypes[i].isValid(result[i])) {
      if (config.columns.get(i).isCleansing()) {
        result[i]=null;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  if (it.hasNext()) {
    row=it.next();
  }
 else {
    row=null;
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns the next row The returned element is sorted as defined by   {@link ImportColumn#index} and contains as many elements as there are columns selected to importfrom  {@link #indexes}. The first row will always contain the names of the columns.   {@link #headerReturned} is used to keep track of that.
 * @return
 */
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  String[] result=new String[indexes.length];
  for (int i=0; i < indexes.length; i++) {
    result[i]=row[indexes[i]];
    if (!dataTypes[i].isValid(result[i])) {
      if (config.columns.get(i).isCleansing()) {
        result[i]=DataType.NULL_VALUE;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  if (it.hasNext()) {
    row=it.next();
  }
 else {
    row=null;
  }
  return result;
}
Program: 108191
Project: 108191
Buggy source:
/** 
 * Returns the next row The returned element is sorted as defined by   {@link ImportColumn#index} and contains as many elements as there are columns selected to importfrom  {@link #indexes}. The first row will always contain the names of the columns.   {@link #headerReturned} is used to keep track of that.
 * @return
 */
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  String[] result=new String[indexes.length];
  for (int i=0; i < indexes.length; i++) {
    row.getCell(indexes[i]).setCellType(Cell.CELL_TYPE_STRING);
    result[i]=row.getCell(indexes[i]).getStringCellValue();
    if (!dataTypes[i].isValid(result[i])) {
      if (config.columns.get(i).isCleansing()) {
        result[i]=null;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  if (iterator.hasNext()) {
    row=iterator.next();
    currentRow++;
  }
 else {
    row=null;
    try {
      input.close();
    }
 catch (    Exception e) {
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns the next row The returned element is sorted as defined by   {@link ImportColumn#index} and contains as many elements as there are columns selected to importfrom  {@link #indexes}. The first row will always contain the names of the columns.   {@link #headerReturned} is used to keep track of that.
 * @return
 */
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  String[] result=new String[indexes.length];
  for (int i=0; i < indexes.length; i++) {
    row.getCell(indexes[i]).setCellType(Cell.CELL_TYPE_STRING);
    result[i]=row.getCell(indexes[i]).getStringCellValue();
    if (!dataTypes[i].isValid(result[i])) {
      if (config.columns.get(i).isCleansing()) {
        result[i]=DataType.NULL_VALUE;
      }
 else {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  if (iterator.hasNext()) {
    row=iterator.next();
    currentRow++;
  }
 else {
    row=null;
    try {
      input.close();
    }
 catch (    Exception e) {
    }
  }
  return result;
}
Program: 108192
Project: 108192
Buggy source:
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  try {
    String[] result=new String[indexes.length];
    for (int i=0; i < indexes.length; i++) {
      result[i]=resultSet.getString(indexes[i]);
      if (!dataTypes[i].isValid(result[i])) {
        if (config.columns.get(i).isCleansing()) {
          result[i]=null;
        }
 else {
          throw new IllegalArgumentException("String_Node_Str");
        }
      }
    }
    hasNext=resultSet.next();
    if (!hasNext) {
      try {
        if (!config.getConnection().isClosed()) {
          config.getConnection().close();
        }
      }
 catch (      Exception e) {
      }
    }
    return result;
  }
 catch (  SQLException e) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public String[] next(){
  if (!headerReturned) {
    headerReturned=true;
    return header;
  }
  try {
    String[] result=new String[indexes.length];
    for (int i=0; i < indexes.length; i++) {
      result[i]=resultSet.getString(indexes[i]);
      if (!dataTypes[i].isValid(result[i])) {
        if (config.columns.get(i).isCleansing()) {
          result[i]=DataType.NULL_VALUE;
        }
 else {
          throw new IllegalArgumentException("String_Node_Str");
        }
      }
    }
    hasNext=resultSet.next();
    if (!hasNext) {
      try {
        if (!config.getConnection().isClosed()) {
          config.getConnection().close();
        }
      }
 catch (      Exception e) {
      }
    }
    return result;
  }
 catch (  SQLException e) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 108193
Project: 108193
Buggy source:
/** 
 * Suppresses entries until the condition is fulfilled
 * @param condition
 * @return the number of tuples that have been suppressed
 */
public int suppressWhileNotFulfilledBinary(PrivacyCondition condition){
  int low=0;
  int high=entries.length - 1;
  int mid=(low + high) / 2;
  int initiallySuppressed=this.suppressed;
  State state=State.ABORT;
  for (int i=low; i <= mid; i++) {
    suppressEntry(entries[i]);
  }
  while (low <= high) {
    state=condition.isFulfilled(this);
    if (state == State.ABORT) {
      break;
    }
 else     if (state == State.FULFILLED) {
      high=mid - 1;
      mid=(low + high) / 2;
      for (int i=mid + 1; i < entries.length && !entries[i].isNotOutlier; i++) {
        unSuppressEntry(entries[i]);
      }
    }
 else {
      low=mid + 1;
      mid=(low + high) / 2;
      for (int i=low; i <= mid; i++) {
        suppressEntry(entries[i]);
      }
    }
  }
  if (state != State.ABORT) {
    state=condition.isFulfilled(this);
    if (state == State.NOT_FULFILLED && mid + 1 < entries.length && entries[mid + 1].isNotOutlier) {
      suppressEntry(entries[mid + 1]);
    }
  }
  return this.suppressed - initiallySuppressed;
}

Fixed version (ground truth):
/** 
 * Suppresses entries until the condition is fulfilled
 * @param condition
 * @return the number of tuples that have been suppressed
 */
public int suppressWhileNotFulfilledBinary(PrivacyCondition condition){
  if (entries.length == 0) {
    return this.suppressed;
  }
  int low=0;
  int high=entries.length - 1;
  int mid=(low + high) / 2;
  int initiallySuppressed=this.suppressed;
  State state=State.ABORT;
  for (int i=low; i <= mid; i++) {
    suppressEntry(entries[i]);
  }
  while (low <= high) {
    state=condition.isFulfilled(this);
    if (state == State.ABORT) {
      break;
    }
 else     if (state == State.FULFILLED) {
      high=mid - 1;
      mid=(low + high) / 2;
      for (int i=mid + 1; i < entries.length && !entries[i].isNotOutlier; i++) {
        unSuppressEntry(entries[i]);
      }
    }
 else {
      low=mid + 1;
      mid=(low + high) / 2;
      for (int i=low; i <= mid; i++) {
        suppressEntry(entries[i]);
      }
    }
  }
  if (state != State.ABORT) {
    state=condition.isFulfilled(this);
    if (state == State.NOT_FULFILLED && mid + 1 < entries.length && entries[mid + 1].isNotOutlier) {
      suppressEntry(entries[mid + 1]);
    }
  }
  return this.suppressed - initiallySuppressed;
}
Program: 108194
Project: 108194
Buggy source:
/** 
 * Generates a version of the image that renders well on windows toolbars, when disabled.
 * @param control
 * @param image
 */
public static Image createDisabledImage(Control control,Image image){
  return new Image(control.getDisplay(),image,SWT.IMAGE_GRAY);
}

Fixed version (ground truth):
/** 
 * Registers an image for a tool item. Generates a version of the image that renders well on windows toolbars, when disabled.
 * @param item
 * @param image
 */
public static void createDisabledImage(ToolItem item){
  item.setDisabledImage(new Image(item.getDisplay(),item.getImage(),SWT.IMAGE_GRAY));
}
Program: 108195
Project: 108195
Buggy source:
/** 
 * Determine information loss of the given node if it can be used for estimating minimum and maximum information loss for tagged nodes.
 * @param node
 */
protected void computeUtilityForMonotonicMetrics(Node node){
  if ((checker.getMetric().isMonotonic() || (checker.getConfiguration().getMaxOutliers() == 0d)) && (node.getInformationLoss() == null)) {
    if (checker.getMetric().isIndependent()) {
      InformationLossWithBound<?> loss=checker.getMetric().getInformationLoss(node,null);
      lattice.setInformationLoss(node,loss.getInformationLoss());
      lattice.setLowerBound(node,loss.getLowerBound());
    }
 else {
      lattice.setChecked(node,checker.check(node,true));
    }
  }
}

Fixed version (ground truth):
/** 
 * Determine information loss of the given node if it can be used for estimating minimum and maximum information loss for tagged nodes.
 * @param node
 */
protected void computeUtilityForMonotonicMetrics(Node node){
  if ((checker.getMetric().isMonotonic() || (checker.getConfiguration().getMaxOutliers() == 0d)) && (node.getInformationLoss() == null)) {
    if (checker.getMetric().isIndependent()) {
      InformationLossWithBound<?> loss=checker.getMetric().getInformationLoss(node,(IHashGroupify)null);
      lattice.setInformationLoss(node,loss.getInformationLoss());
      lattice.setLowerBound(node,loss.getLowerBound());
    }
 else {
      lattice.setChecked(node,checker.check(node,true));
    }
  }
}
Program: 108196
Project: 108196
Buggy source:
/** 
 * Checks and tags the given transformation.
 * @param node
 * @param configuration
 */
private void checkAndTag(Node node,FLASHPhaseConfiguration configuration){
  if (configuration.getTriggerEvaluate().appliesTo(node)) {
    InformationLossWithBound<?> loss=checker.getMetric().getInformationLoss(node,null);
    lattice.setInformationLoss(node,loss.getInformationLoss());
    lattice.setLowerBound(node,loss.getLowerBound());
    if (loss.getLowerBound() == null) {
      lattice.setLowerBound(node,checker.getMetric().getLowerBound(node));
    }
  }
 else   if (configuration.getTriggerCheck().appliesTo(node)) {
    lattice.setChecked(node,checker.check(node));
  }
  trackOptimum(node);
  configuration.getTriggerTag().apply(node);
  prune(node);
}

Fixed version (ground truth):
/** 
 * Checks and tags the given transformation.
 * @param node
 * @param configuration
 */
private void checkAndTag(Node node,FLASHPhaseConfiguration configuration){
  if (configuration.getTriggerEvaluate().appliesTo(node)) {
    InformationLossWithBound<?> loss=checker.getMetric().getInformationLoss(node,(IHashGroupify)null);
    lattice.setInformationLoss(node,loss.getInformationLoss());
    lattice.setLowerBound(node,loss.getLowerBound());
    if (loss.getLowerBound() == null) {
      lattice.setLowerBound(node,checker.getMetric().getLowerBound(node));
    }
  }
 else   if (configuration.getTriggerCheck().appliesTo(node)) {
    lattice.setChecked(node,checker.check(node));
  }
  trackOptimum(node);
  configuration.getTriggerTag().apply(node);
  prune(node);
}
Program: 108197
Project: 108197
Buggy source:
/** 
 * Internal adder method.
 * @param key the key
 * @param hash the hash
 * @param representant
 * @param count
 * @param pcount
 * @return the hash groupify entry
 */
private final HashGroupifyEntry addInternal(final int[] key,final int hash,final int representant,int count,final int pcount){
  if (subset != null && !subset.contains(representant)) {
    count=0;
  }
  int index=hash & (buckets.length - 1);
  HashGroupifyEntry entry=findEntry(key,index,hash);
  if (entry == null) {
    if (++elementCount > threshold) {
      rehash();
      index=hash & (buckets.length - 1);
    }
    entry=createEntry(key,index,hash,representant);
  }
  entry.count+=count;
  if (subset != null) {
    entry.pcount+=pcount;
    if (count > 0 && entry.count == 0) {
      entry.representant=representant;
    }
  }
  if (entry.count >= k) {
    if (!entry.isNotOutlier) {
      entry.isNotOutlier=true;
      currentOutliers-=(entry.count - count);
    }
  }
 else {
    currentOutliers+=count;
  }
  if (subset == null || count > 0) {
    entry.representant=entry.representant < representant ? entry.representant : representant;
  }
  return entry;
}

Fixed version (ground truth):
/** 
 * Internal adder method.
 * @param key the key
 * @param hash the hash
 * @param representant
 * @param count
 * @param pcount
 * @return the hash groupify entry
 */
private final HashGroupifyEntry addInternal(final int[] key,final int hash,final int representant,int count,final int pcount){
  if (subset != null && !subset.contains(representant)) {
    count=0;
  }
  int index=hash & (buckets.length - 1);
  HashGroupifyEntry entry=findEntry(key,index,hash);
  if (entry == null) {
    if (++elementCount > threshold) {
      rehash();
      index=hash & (buckets.length - 1);
    }
    entry=createEntry(key,index,hash,representant);
  }
  entry.count+=count;
  if (subset != null) {
    entry.pcount+=pcount;
    if (count > 0 && entry.count == count) {
      entry.representant=representant;
    }
  }
  if (entry.count >= k) {
    if (!entry.isNotOutlier) {
      entry.isNotOutlier=true;
      currentOutliers-=(entry.count - count);
    }
  }
 else {
    currentOutliers+=count;
  }
  if (subset == null || count > 0) {
    entry.representant=entry.representant < representant ? entry.representant : representant;
  }
  return entry;
}
Program: 108198
Project: 108198
Buggy source:
/** 
 * Returns the average class size
 * @return
 */
public double getAverageClassSize(){
  return numClasses / numTuples;
}

Fixed version (ground truth):
/** 
 * Returns the average class size
 * @return
 */
public double getAverageClassSize(){
  return numTuples / numClasses;
}
Program: 108199
Project: 108199
Buggy source:
public int compare(HashGroupifyEntry o1,HashGroupifyEntry o2){
  return Integer.compare(o1.representant,o2.representant);
}

Fixed version (ground truth):
public int compare(HashGroupifyEntry o1,HashGroupifyEntry o2){
  int cmp=Integer.compare(o1.count,o2.count);
  return cmp != 0 ? cmp : Integer.compare(o1.representant,o2.representant);
}
Program: 108200
Project: 108200
Buggy source:
/** 
 * Creates a new instance
 * @param entry
 */
HashGroupifyDistribution(HashGroupifyEntry entry){
  List<HashGroupifyEntry> list=new ArrayList<HashGroupifyEntry>();
  while (entry != null) {
    if (entry.isNotOutlier) {
      this.numClasses++;
      addToDistribution(entry.count);
      list.add(entry);
    }
 else {
      this.suppressed+=entry.count;
    }
    numTuples+=entry.count;
    entry=entry.nextOrdered;
  }
  if (suppressed != 0) {
    this.distribution.putOrAdd(suppressed,1,1);
    this.numClasses++;
  }
  Collections.sort(list,new Comparator<HashGroupifyEntry>(){
    public int compare(    HashGroupifyEntry o1,    HashGroupifyEntry o2){
      return Integer.compare(o1.representant,o2.representant);
    }
  }
);
  this.entries=list.toArray(new HashGroupifyEntry[list.size()]);
}

Fixed version (ground truth):
/** 
 * Creates a new instance
 * @param entry
 */
HashGroupifyDistribution(HashGroupifyEntry entry){
  List<HashGroupifyEntry> list=new ArrayList<HashGroupifyEntry>();
  while (entry != null) {
    if (entry.isNotOutlier && entry.count > 0) {
      this.numClasses++;
      addToDistribution(entry.count);
      list.add(entry);
    }
 else {
      this.suppressed+=entry.count;
    }
    numTuples+=entry.count;
    entry=entry.nextOrdered;
  }
  if (suppressed != 0) {
    this.distribution.putOrAdd(suppressed,1,1);
    this.numClasses++;
  }
  Collections.sort(list,new Comparator<HashGroupifyEntry>(){
    public int compare(    HashGroupifyEntry o1,    HashGroupifyEntry o2){
      int cmp=Integer.compare(o1.count,o2.count);
      return cmp != 0 ? cmp : Integer.compare(o1.representant,o2.representant);
    }
  }
);
  this.entries=list.toArray(new HashGroupifyEntry[list.size()]);
}
Program: 108201
Project: 108201
Buggy source:
/** 
 * Analyzes the content of the hash table. Checks the privacy criteria against each class.
 */
private void analyzeWithEarlyAbort(){
  kAnonymous=(currentOutliers <= absoluteMaxOutliers);
  if (classBasedCriteria.length == 0) {
    anonymous=kAnonymous;
    return;
  }
  if (k != Integer.MAX_VALUE && !kAnonymous) {
    anonymous=false;
    return;
  }
  currentOutliers=0;
  HashGroupifyEntry entry=firstEntry;
  while (entry != null) {
    int anonymous=isAnonymous(entry);
    if (anonymous != -1) {
      if (dpresence && entry.count == 0 && anonymous == 1) {
        this.anonymous=false;
        return;
      }
      currentOutliers+=entry.count;
      if (currentOutliers > absoluteMaxOutliers) {
        this.anonymous=false;
        return;
      }
    }
    entry.isNotOutlier=entry.count != 0 ? (anonymous == -1) : true;
    entry=entry.nextOrdered;
  }
  this.analyzeSampleBasedCriteria(true);
  this.anonymous=(currentOutliers <= absoluteMaxOutliers);
}

Fixed version (ground truth):
/** 
 * Analyzes the content of the hash table. Checks the privacy criteria against each class.
 */
private void analyzeWithEarlyAbort(){
  kAnonymous=(currentOutliers <= absoluteMaxOutliers);
  if (classBasedCriteria.length == 0 && sampleBasedCriteria.length == 0) {
    anonymous=kAnonymous;
    return;
  }
  if (k != Integer.MAX_VALUE && !kAnonymous) {
    anonymous=false;
    return;
  }
  currentOutliers=0;
  HashGroupifyEntry entry=firstEntry;
  while (entry != null) {
    int anonymous=isAnonymous(entry);
    if (anonymous != -1) {
      if (dpresence && entry.count == 0 && anonymous == 1) {
        this.anonymous=false;
        return;
      }
      currentOutliers+=entry.count;
      if (currentOutliers > absoluteMaxOutliers) {
        this.anonymous=false;
        return;
      }
    }
    entry.isNotOutlier=entry.count != 0 ? (anonymous == -1) : true;
    entry=entry.nextOrdered;
  }
  this.analyzeSampleBasedCriteria(true);
  this.anonymous=(currentOutliers <= absoluteMaxOutliers);
}
Program: 108202
Project: 108202
Buggy source:
/** 
 * Creates a new instance
 * @param entry
 */
HashGroupifyDistribution(HashGroupifyEntry entry){
  List<HashGroupifyEntry> list=new ArrayList<HashGroupifyEntry>();
  while (entry != null) {
    if (entry.isNotOutlier && entry.count > 0) {
      this.numClasses++;
      addToDistribution(entry.count);
      list.add(entry);
    }
 else {
      this.suppressed+=entry.count;
    }
    numTuples+=entry.count;
    entry=entry.nextOrdered;
  }
  if (suppressed != 0) {
    this.distribution.putOrAdd(suppressed,1,1);
    this.numClasses++;
  }
  Collections.sort(list,new Comparator<HashGroupifyEntry>(){
    public int compare(    HashGroupifyEntry o1,    HashGroupifyEntry o2){
      int cmp=Integer.compare(o1.count,o2.count);
      return cmp != 0 ? cmp : Integer.compare(o1.representant,o2.representant);
    }
  }
);
  this.entries=list.toArray(new HashGroupifyEntry[list.size()]);
}

Fixed version (ground truth):
/** 
 * Creates a new instance
 * @param entry
 */
HashGroupifyDistribution(HashGroupifyEntry entry){
  List<HashGroupifyEntry> list=new ArrayList<HashGroupifyEntry>();
  while (entry != null) {
    if (entry.isNotOutlier && entry.count > 0) {
      addToDistribution(entry.count);
      list.add(entry);
    }
 else {
      this.suppressed+=entry.count;
    }
    numTuples+=entry.count;
    entry=entry.nextOrdered;
  }
  if (suppressed != 0) {
    addToDistribution(suppressed);
  }
  Collections.sort(list,new Comparator<HashGroupifyEntry>(){
    public int compare(    HashGroupifyEntry o1,    HashGroupifyEntry o2){
      int cmp=Integer.compare(o1.count,o2.count);
      return cmp != 0 ? cmp : Integer.compare(o1.representant,o2.representant);
    }
  }
);
  this.entries=list.toArray(new HashGroupifyEntry[list.size()]);
}
Program: 108205
Project: 108205
Buggy source:
@Override public void reset(){
  root.setRedraw(false);
  if (table != null)   table.removeAll();
  root.setRedraw(true);
  SWTUtil.disable(root);
}

Fixed version (ground truth):
@Override public void reset(){
  root.setRedraw(false);
  if (table != null) {
    table.removeAll();
  }
  root.setRedraw(true);
  SWTUtil.disable(root);
}
Program: 108206
Project: 108206
Buggy source:
/** 
 * Updates the view.
 * @param node
 */
private void update(){
  root.setRedraw(false);
  for (int i=0; i < combo.getItemCount(); i++) {
    if (combo.getItem(i).equals(model.getRiskModel().getRegion().getName())) {
      combo.select(i);
      break;
    }
  }
  DataHandle handle=model.getInputConfig().getInput().getHandle();
  text.setText(format.format(model.getRiskModel().getSampleFraction(handle)));
  text2.setText(format.format(model.getRiskModel().getPopulationSize(handle)));
  root.setRedraw(true);
  SWTUtil.enable(root);
}

Fixed version (ground truth):
/** 
 * Updates the view.
 * @param node
 */
private void update(){
  if (model == null || model.getInputConfig() == null || model.getInputConfig().getInput() == null) {
    return;
  }
  root.setRedraw(false);
  for (int i=0; i < combo.getItemCount(); i++) {
    if (combo.getItem(i).equals(model.getRiskModel().getRegion().getName())) {
      combo.select(i);
      break;
    }
  }
  DataHandle handle=model.getInputConfig().getInput().getHandle();
  text.setText(format.format(model.getRiskModel().getSampleFraction(handle)));
  text2.setText(format.format(model.getRiskModel().getPopulationSize(handle)));
  root.setRedraw(true);
  SWTUtil.enable(root);
}
Program: 108208
Project: 108208
Buggy source:
/** 
 * Updates the view.
 * @param node
 */
private void update(){
  root.setRedraw(false);
  SWTUtil.enable(root);
  ARXPopulationModel popmodel=model.getInputPopulationModel();
  if (model.getOutputPopulationModel() != null) {
    popmodel=model.getOutputPopulationModel();
  }
  for (int i=0; i < list.getItemCount(); i++) {
    if (list.getItem(i).equals(popmodel.getRegion().getName())) {
      list.select(i);
      break;
    }
  }
  DataHandle handle=model.getInputConfig().getInput().getHandle();
  text.setText(format.format(popmodel.getSampleFraction(handle)));
  text.setEnabled(true);
  text2.setText(format.format(popmodel.getPopulationSize(handle)));
  text2.setEnabled(true);
  root.setRedraw(true);
}

Fixed version (ground truth):
/** 
 * Updates the view.
 * @param node
 */
private void update(){
  if (model == null || model.getInputConfig() == null || model.getInputConfig().getInput() == null) {
    return;
  }
  root.setRedraw(false);
  SWTUtil.enable(root);
  ARXPopulationModel popmodel=model.getInputPopulationModel();
  if (model.getOutputPopulationModel() != null) {
    popmodel=model.getOutputPopulationModel();
  }
  for (int i=0; i < list.getItemCount(); i++) {
    if (list.getItem(i).equals(popmodel.getRegion().getName())) {
      list.select(i);
      break;
    }
  }
  DataHandle handle=model.getInputConfig().getInput().getHandle();
  text.setText(format.format(popmodel.getSampleFraction(handle)));
  text.setEnabled(true);
  text2.setText(format.format(popmodel.getPopulationSize(handle)));
  text2.setEnabled(true);
  root.setRedraw(true);
}