nus-yam/ex-repair huggingface dataset:
Program: 107876
Project: 107876
Buggy source:
/** 
 * Adds a new value
 * @param confidence
 * @param correct
 */
void add(double confidence,boolean correct){
  for (int i=0; i < CONFIDENCE_THRESHOLDS.length; i++) {
    if (confidence >= CONFIDENCE_THRESHOLDS[i]) {
      falsePositive[i]++;
      truePositive[i]+=correct ? 1d : 0d;
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds a new value
 * @param confidence
 * @param correct
 */
void add(double confidence,boolean correct){
  for (int i=0; i < CONFIDENCE_THRESHOLDS.length; i++) {
    if (confidence >= CONFIDENCE_THRESHOLDS[i]) {
      falsePositive[i]+=correct ? 0d : 1d;
      truePositive[i]+=correct ? 1d : 0d;
    }
  }
}
Program: 107877
Project: 107877
Buggy source:
/** 
 * @return the truePositive
 */
public double[] getTruePositiveRate(){
  return truePositive;
}

Fixed version (ground truth):
/** 
 * Returns true-positive rates for all cut-off points
 * @return the truePositive
 */
public double[] getTruePositiveRate(){
  return truePositive;
}
Program: 107878
Project: 107878
Buggy source:
/** 
 * Packs the results
 */
void pack(){
  for (int i=0; i < CONFIDENCE_THRESHOLDS.length; i++) {
    if (falsePositive[i] == 0d) {
      truePositive[i]=0d;
    }
 else {
      double total=falsePositive[i];
      falsePositive[i]-=truePositive[i];
      falsePositive[i]/=total;
      truePositive[i]/=total;
    }
  }
}

Fixed version (ground truth):
/** 
 * Packs the results
 * @param classifications 
 */
void pack(int classifications){
  for (int i=0; i < CONFIDENCE_THRESHOLDS.length; i++) {
    truePositive[i]/=(double)exists;
    falsePositive[i]/=(double)(classifications - exists);
  }
  GenericSorting.mergeSort(0,falsePositive.length,new IntComparator(){
    @Override public int compare(    int arg0,    int arg1){
      return Double.compare(falsePositive[arg0],falsePositive[arg1]);
    }
  }
,new Swapper(){
    @Override public void swap(    int arg0,    int arg1){
      double temp=falsePositive[arg0];
      falsePositive[arg0]=falsePositive[arg1];
      falsePositive[arg1]=temp;
      temp=truePositive[arg0];
      truePositive[arg0]=truePositive[arg1];
      truePositive[arg1]=temp;
    }
  }
);
  if (truePositive[0] != 0 && falsePositive[0] != 0) {
    truePositive=insert(truePositive,0,0d);
    falsePositive=insert(falsePositive,0,0d);
  }
  if (truePositive[truePositive.length - 1] != 1 && falsePositive[falsePositive.length - 1] != 1) {
    truePositive=insert(truePositive,truePositive.length,1d);
    falsePositive=insert(falsePositive,falsePositive.length,1d);
  }
}
Program: 107880
Project: 107880
Buggy source:
/** 
 * Creates a new instance
 * @param inputFeatureHandle
 * @param outputFeatureHandle
 * @param scaling
 * @param classHandle
 * @param features
 * @param clazz
 * @param interrupt
 */
public ClassificationDataSpecification(DataHandleInternal inputFeatureHandle,DataHandleInternal outputFeatureHandle,ARXFeatureScaling scaling,String[] features,String clazz,WrappedBoolean interrupt){
  if (clazz == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (outputFeatureHandle.getColumnIndexOf(clazz) == -1) {
    throw new IllegalArgumentException("String_Node_Str" + clazz + "String_Node_Str");
  }
  if (features == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  String feature : features) {
    if (feature == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (inputFeatureHandle.getColumnIndexOf(feature) == -1) {
      throw new IllegalArgumentException("String_Node_Str" + feature + "String_Node_Str");
    }
  }
  this.interrupt=interrupt;
  this.featureIndices=getFeatureIndices(inputFeatureHandle,features,clazz);
  this.featureMetadata=getFeatureMetadata(inputFeatureHandle,featureIndices,scaling);
  this.classIndex=getClassIndex(outputFeatureHandle,clazz);
  this.classMap=getClassMap(outputFeatureHandle,classIndex);
  if (classMap.size() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Creates a new instance
 * @param inputFeatureHandle
 * @param outputFeatureHandle
 * @param scaling
 * @param classHandle
 * @param features
 * @param clazz
 * @param interrupt
 */
public ClassificationDataSpecification(DataHandleInternal inputFeatureHandle,DataHandleInternal outputFeatureHandle,ARXFeatureScaling scaling,String[] features,String clazz,WrappedBoolean interrupt){
  if (clazz == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (outputFeatureHandle.getColumnIndexOf(clazz) == -1) {
    throw new IllegalArgumentException("String_Node_Str" + clazz + "String_Node_Str");
  }
  if (features == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  String feature : features) {
    if (feature == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (inputFeatureHandle.getColumnIndexOf(feature) == -1) {
      throw new IllegalArgumentException("String_Node_Str" + feature + "String_Node_Str");
    }
  }
  this.interrupt=interrupt;
  this.featureIndices=getFeatureIndices(inputFeatureHandle,features,clazz);
  this.featureMetadata=getFeatureMetadata(inputFeatureHandle,featureIndices,scaling);
  this.classIndex=getClassIndex(outputFeatureHandle,clazz);
  this.classMap=getClassMap(outputFeatureHandle,classIndex);
  classMapInverse=getInverseClassMap(this.classMap);
  if (classMap.size() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 107881
Project: 107881
Buggy source:
/** 
 * Frees resources
 */
public void reset(){
  history.reset();
  history.setSize(0);
  currentGroupify.stateClear();
  lastGroupify.stateClear();
}

Fixed version (ground truth):
/** 
 * Frees resources
 */
public void reset(){
  stateMachine.reset();
  history.reset();
  history.setSize(0);
  currentGroupify.stateClear();
  lastGroupify.stateClear();
}
Program: 107882
Project: 107882
Buggy source:
/** 
 * Disposes the given item.
 * @param text
 */
public void disposeItem(String text){
  for (  CTabItem item : folder.getItems()) {
    if (item.getText().equals(text)) {
      item.dispose();
    }
  }
}

Fixed version (ground truth):
/** 
 * Disposes the given item.
 * @param text
 */
public void disposeItem(String text){
  for (  CTabItem item : folder.getItems()) {
    if (item.getText().equals(text)) {
      Iterator<TitledFolderEntry> iter=this.entries.iterator();
      while (iter.hasNext()) {
        if (iter.next().control == item.getControl()) {
          iter.remove();
        }
      }
      item.dispose();
    }
  }
}
Program: 107883
Project: 107883
Buggy source:
/** 
 * Shows the settings for the attribute weights.
 */
private void showSettingsAttributeWeights(){
  if (this.viewAttributeWeights != null)   return;
  Composite composite1=folder.createItem(Resources.getMessage("String_Node_Str"),null);
  composite1.setLayout(new FillLayout());
  this.viewAttributeWeights=new ViewAttributeWeights(composite1,controller);
  this.viewAttributeWeights.update(new ModelEvent(this,ModelPart.MODEL,this.model));
}

Fixed version (ground truth):
/** 
 * Shows the settings for the attribute weights.
 */
private void showSettingsAttributeWeights(){
  if (this.viewAttributeWeights == null) {
    Composite composite1=folder.createItem(Resources.getMessage("String_Node_Str"),null);
    composite1.setLayout(new FillLayout());
    this.viewAttributeWeights=new ViewAttributeWeights(composite1,controller);
  }
  this.viewAttributeWeights.update(new ModelEvent(this,ModelPart.MODEL,this.model));
}
Program: 107884
Project: 107884
Buggy source:
/** 
 * Shows the settings for the coding model.
 */
private void showSettingsCodingModel(){
  if (this.viewCodingModel != null)   return;
  Composite composite2=folder.createItem(Resources.getMessage("String_Node_Str"),null);
  composite2.setLayout(new FillLayout());
  this.viewCodingModel=new ViewCodingModel(composite2,controller);
  this.viewCodingModel.update(new ModelEvent(this,ModelPart.MODEL,this.model));
}

Fixed version (ground truth):
/** 
 * Shows the settings for the coding model.
 */
private void showSettingsCodingModel(){
  if (this.viewCodingModel == null) {
    Composite composite2=folder.createItem(Resources.getMessage("String_Node_Str"),null);
    composite2.setLayout(new FillLayout());
    this.viewCodingModel=new ViewCodingModel(composite2,controller);
  }
  this.viewCodingModel.update(new ModelEvent(this,ModelPart.MODEL,this.model));
}
Program: 107885
Project: 107885
Buggy source:
@Override public void reset(){
  for (  TableItem item : features.getItems()) {
    item.dispose();
  }
  for (  TableItem item : classes.getItems()) {
    item.dispose();
  }
  SWTUtil.disable(root);
}

Fixed version (ground truth):
@Override public void reset(){
  for (  TableItem item : features.getItems()) {
    item.dispose();
  }
  for (  TableItem item : classes.getItems()) {
    item.dispose();
  }
  state=null;
  SWTUtil.disable(root);
}
Program: 107886
Project: 107886
Buggy source:
@Override public void modifyText(ModifyEvent arg0){
  Granularity g=null;
  if (table.getSelection() != null && table.getSelection().length != 0) {
    g=(Granularity)table.getSelection()[0].getData();
  }
  if (g.isFormatSupported()) {
    String formatString=text.getText();
    if (g != null && model.getFormat().isValid(formatString,g.getDefaultFormat())) {
      decoration.hide();
      model.getFormat().set((Granularity)table.getSelection()[0].getData(),formatString);
    }
 else {
      decoration.setDescriptionText(Resources.getMessage("String_Node_Str"));
      Image image=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
      decoration.setImage(image);
      decoration.show();
    }
  }
 else {
    decoration.hide();
  }
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent arg0){
  Granularity g=null;
  if (table.getSelection() != null && table.getSelection().length != 0) {
    g=(Granularity)table.getSelection()[0].getData();
  }
  if (g.isFormatSupported()) {
    String formatString=text.getText();
    if (g != null && model.getFormat().isValid(formatString,g.getDefaultFormat())) {
      decoration.hide();
      Format format=model.getFormat();
      format.set((Granularity)table.getSelection()[0].getData(),formatString);
      model.setFormat(format);
    }
 else {
      decoration.setDescriptionText(Resources.getMessage("String_Node_Str"));
      Image image=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
      decoration.setImage(image);
      decoration.show();
    }
  }
 else {
    decoration.hide();
  }
}
Program: 107888
Project: 107888
Buggy source:
/** 
 * Creates a list of all available granularities
 * @param table
 */
private void createItems(DynamicTable table){
  for (  Granularity g : Granularity.values()) {
    TableItem item=new TableItem(table,SWT.CHECK);
    item.setText(Resources.getMessage("String_Node_Str" + g.toString()));
    item.setData(g);
  }
}

Fixed version (ground truth):
/** 
 * Creates a list of all available granularities
 * @param table
 */
private void createItems(DynamicTable table){
  for (  Granularity g : Granularity.values()) {
    TableItem item=new TableItem(table,SWT.CHECK);
    item.setText(Resources.getMessage("String_Node_Str" + g.toString()));
    item.setData(g);
    item.setChecked(model.getGranularities().contains(g));
  }
}
Program: 107890
Project: 107890
Buggy source:
/** 
 * Sets the result.
 * @param result
 */
public void setResult(final ARXResult result){
  this.result=result;
  if ((result != null) && (result.getGlobalOptimum() != null)) {
    optimalNodeAsString=Arrays.toString(result.getGlobalOptimum().getTransformation());
  }
  setModified();
}

Fixed version (ground truth):
/** 
 * Sets the result.
 * @param result
 */
public void setResult(final ARXResult result){
  this.result=result;
  if ((result != null) && (result.getGlobalOptimum() != null)) {
    optimalNodeAsString=Arrays.toString(result.getGlobalOptimum().getTransformation());
  }
 else {
    optimalNodeAsString=null;
  }
  setModified();
}
Program: 107891
Project: 107891
Buggy source:
/** 
 * Returns the output definition.
 * @return
 */
public DataDefinition getOutputDefinition(){
  if (this.output == null)   return null;
 else   return this.output.getDefinition();
}

Fixed version (ground truth):
/** 
 * Returns the output definition.
 * @return
 */
public DataDefinition getOutputDefinition(){
  if (this.output == null) {
    if (this.result != null) {
      return this.result.getDataDefinition();
    }
 else {
      return null;
    }
  }
 else   return this.output.getDefinition();
}
Program: 107894
Project: 107894
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(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();
}

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 | SWT.FULL_SELECTION);
  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: 107895
Project: 107895
Buggy source:
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(SWTUtil.createGridLayout(1));
  table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  table.setMenu(new ClipboardHandlerTable(table).getMenu());
  table.setLayoutData(SWTUtil.createFillGridData());
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  SWTUtil.createColumnWithBarCharts(table,c);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return root;
}

Fixed version (ground truth):
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(SWTUtil.createGridLayout(1));
  table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.FULL_SELECTION);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  table.setMenu(new ClipboardHandlerTable(table).getMenu());
  table.setLayoutData(SWTUtil.createFillGridData());
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  SWTUtil.createColumnWithBarCharts(table,c);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return root;
}
Program: 107896
Project: 107896
Buggy source:
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(new FillLayout());
  table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  table.setMenu(new ClipboardHandlerTable(table).getMenu());
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  SWTUtil.createColumnWithBarCharts(table,c);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  SWTUtil.createColumnWithBarCharts(table,c);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return this.root;
}

Fixed version (ground truth):
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(new FillLayout());
  table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.FULL_SELECTION);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  table.setMenu(new ClipboardHandlerTable(table).getMenu());
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  SWTUtil.createColumnWithBarCharts(table,c);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  SWTUtil.createColumnWithBarCharts(table,c);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return this.root;
}
Program: 107898
Project: 107898
Buggy source:
/** 
 * Creates the view.
 * @param root
 */
private void create(final Composite root){
  root.setLayout(new FillLayout());
  final Tree tree=new Tree(root,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
  tree.setHeaderVisible(true);
  treeViewer=new TreeViewer(tree);
  tree.setMenu(new ClipboardHandlerTree(treeViewer).getMenu());
  final TreeColumn column1=new TreeColumn(tree,SWT.LEFT);
  tree.setLinesVisible(true);
  column1.setAlignment(SWT.LEFT);
  column1.setText(Resources.getMessage("String_Node_Str"));
  column1.setWidth(160);
  final TreeColumn column2=new TreeColumn(tree,SWT.RIGHT);
  column2.setAlignment(SWT.LEFT);
  column2.setText(Resources.getMessage("String_Node_Str"));
  column2.setWidth(100);
  treeViewer.setContentProvider(new OutputContentProvider());
  treeViewer.setLabelProvider(new OutputLabelProvider());
  treeViewer.setInput(roots);
  treeViewer.expandAll();
}

Fixed version (ground truth):
/** 
 * Creates the view.
 * @param root
 */
private void create(final Composite root){
  root.setLayout(new FillLayout());
  final Tree tree=new Tree(root,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL| SWT.FULL_SELECTION);
  tree.setHeaderVisible(true);
  treeViewer=new TreeViewer(tree);
  tree.setMenu(new ClipboardHandlerTree(treeViewer).getMenu());
  final TreeColumn column1=new TreeColumn(tree,SWT.LEFT);
  tree.setLinesVisible(true);
  column1.setAlignment(SWT.LEFT);
  column1.setText(Resources.getMessage("String_Node_Str"));
  column1.setWidth(160);
  final TreeColumn column2=new TreeColumn(tree,SWT.RIGHT);
  column2.setAlignment(SWT.LEFT);
  column2.setText(Resources.getMessage("String_Node_Str"));
  column2.setWidth(100);
  treeViewer.setContentProvider(new OutputContentProvider());
  treeViewer.setLabelProvider(new OutputLabelProvider());
  treeViewer.setInput(roots);
  treeViewer.expandAll();
}
Program: 107899
Project: 107899
Buggy source:
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(new FillLayout());
  this.table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
  this.table.setHeaderVisible(true);
  this.table.setLinesVisible(true);
  this.table.setMenu(new ClipboardHandlerTable(table).getMenu());
  String size="String_Node_Str";
  if (super.getTarget() == ModelPart.OUTPUT) {
    size="String_Node_Str";
  }
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth(size,"String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth(size,"String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  if (super.getTarget() == ModelPart.OUTPUT) {
    c=new DynamicTableColumn(table,SWT.LEFT);
    c.setWidth(size,"String_Node_Str");
    c.setText(Resources.getMessage("String_Node_Str"));
  }
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return root;
}

Fixed version (ground truth):
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(new FillLayout());
  this.table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.FULL_SELECTION);
  this.table.setHeaderVisible(true);
  this.table.setLinesVisible(true);
  this.table.setMenu(new ClipboardHandlerTable(table).getMenu());
  String size="String_Node_Str";
  if (super.getTarget() == ModelPart.OUTPUT) {
    size="String_Node_Str";
  }
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth(size,"String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth(size,"String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  if (super.getTarget() == ModelPart.OUTPUT) {
    c=new DynamicTableColumn(table,SWT.LEFT);
    c.setWidth(size,"String_Node_Str");
    c.setText(Resources.getMessage("String_Node_Str"));
  }
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return root;
}
Program: 107901
Project: 107901
Buggy source:
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(new FillLayout());
  this.table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
  this.table.setHeaderVisible(true);
  this.table.setLinesVisible(true);
  this.table.setMenu(new ClipboardHandlerTable(table).getMenu());
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return root;
}

Fixed version (ground truth):
@Override protected Control createControl(Composite parent){
  this.root=new Composite(parent,SWT.NONE);
  this.root.setLayout(new FillLayout());
  this.table=SWTUtil.createTableDynamic(root,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.FULL_SELECTION);
  this.table.setHeaderVisible(true);
  this.table.setLinesVisible(true);
  this.table.setMenu(new ClipboardHandlerTable(table).getMenu());
  DynamicTableColumn c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  c=new DynamicTableColumn(table,SWT.LEFT);
  c.setWidth("String_Node_Str","String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  final TableColumn col : table.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(table);
  return root;
}
Program: 107902
Project: 107902
Buggy source:
/** 
 * Updates the view.
 * @param node
 */
private void update(){
  if (model == null || model.getInputConfig() == null || model.getInputConfig().getInput() == null) {
    return;
  }
  DataHandle handle=model.getInputConfig().getInput().getHandle();
  root.setRedraw(false);
  for (  TableItem item : features.getItems()) {
    item.dispose();
  }
  for (  TableItem item : classes.getItems()) {
    item.dispose();
  }
  for (int col=0; col < handle.getNumColumns(); col++) {
    String attribute=handle.getAttributeName(col);
    DataDefinition def=model.getOutputDefinition() == null ? model.getInputDefinition() : model.getInputDefinition();
    Image image=controller.getResources().getImage(def.getAttributeType(attribute));
    TableItem itemF=new TableItem(features,SWT.NONE);
    itemF.setText(new String[]{"String_Node_Str",attribute});
    itemF.setImage(0,image);
    itemF.setChecked(model.getSelectedFeatures().contains(attribute));
    TableItem itemC=new TableItem(classes,SWT.NONE);
    itemC.setText(attribute);
    itemC.setChecked(model.getSelectedClasses().contains(attribute));
  }
  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;
  }
  DataHandle handle=model.getInputConfig().getInput().getHandle();
  root.setRedraw(false);
  for (  TableItem item : features.getItems()) {
    item.dispose();
  }
  for (  TableItem item : classes.getItems()) {
    item.dispose();
  }
  for (int col=0; col < handle.getNumColumns(); col++) {
    String attribute=handle.getAttributeName(col);
    DataDefinition def=model.getOutputDefinition() == null ? model.getInputDefinition() : model.getOutputDefinition();
    Image image=controller.getResources().getImage(def.getAttributeType(attribute));
    TableItem itemF=new TableItem(features,SWT.NONE);
    itemF.setText(new String[]{"String_Node_Str",attribute});
    itemF.setImage(0,image);
    itemF.setChecked(model.getSelectedFeatures().contains(attribute));
    TableItem itemC=new TableItem(classes,SWT.NONE);
    itemC.setText(attribute);
    itemC.setChecked(model.getSelectedClasses().contains(attribute));
  }
  root.setRedraw(true);
  SWTUtil.enable(root);
}
Program: 107903
Project: 107903
Buggy source:
/** 
 * Checks the selected items and fires an event on changes
 */
private void fireEvent(){
  Set<String> selectedFeatures=new HashSet<String>();
  for (  TableItem item : features.getItems()) {
    if (item.getChecked()) {
      selectedFeatures.add(item.getText());
    }
  }
  Set<String> selectedClasses=new HashSet<String>();
  for (  TableItem item : classes.getItems()) {
    if (item.getChecked()) {
      selectedClasses.add(item.getText());
    }
  }
  if (model != null) {
    boolean modified=false;
    if (!selectedFeatures.equals(model.getSelectedFeatures())) {
      model.setSelectedFeatures(selectedFeatures);
      modified=true;
    }
    if (!selectedClasses.equals(model.getSelectedClasses())) {
      model.setSelectedClasses(selectedClasses);
      modified=true;
    }
    if (modified) {
      controller.update(new ModelEvent(ViewClassificationAttributes.this,ModelPart.SELECTED_FEATURES_OR_CLASSES,null));
    }
  }
}

Fixed version (ground truth):
/** 
 * Checks the selected items and fires an event on changes
 */
private void fireEvent(){
  Set<String> selectedFeatures=new HashSet<String>();
  for (  TableItem item : features.getItems()) {
    if (item.getChecked()) {
      selectedFeatures.add(item.getText(1));
    }
  }
  Set<String> selectedClasses=new HashSet<String>();
  for (  TableItem item : classes.getItems()) {
    if (item.getChecked()) {
      selectedClasses.add(item.getText());
    }
  }
  if (model != null) {
    boolean modified=false;
    if (!selectedFeatures.equals(model.getSelectedFeatures())) {
      model.setSelectedFeatures(selectedFeatures);
      modified=true;
    }
    if (!selectedClasses.equals(model.getSelectedClasses())) {
      model.setSelectedClasses(selectedClasses);
      modified=true;
    }
    if (modified) {
      controller.update(new ModelEvent(ViewClassificationAttributes.this,ModelPart.SELECTED_FEATURES_OR_CLASSES,null));
    }
  }
}
Program: 107904
Project: 107904
Buggy source:
@Override public int compare(int arg0,int arg1){
  checkInterrupt();
  Integer order1=order.get(array[arg0]);
  Integer order2=order.get(array[arg1]);
  if (order1 == null || order2 == null) {
    throw new RuntimeException("String_Node_Str");
  }
 else {
    return order1.compareTo(order2);
  }
}

Fixed version (ground truth):
@Override public int compare(int arg0,int arg1){
  checkInterrupt();
  Integer order1=order.get(array[arg0]);
  Integer order2=order.get(array[arg1]);
  if (order1 == null || order2 == null) {
    String message="String_Node_Str";
    message+=order1 == null ? "String_Node_Str" + array[arg0] + "String_Node_Str" : "String_Node_Str";
    message+=order2 == null ? "String_Node_Str" + array[arg1] + "String_Node_Str" : "String_Node_Str";
    throw new RuntimeException(message);
  }
 else {
    return order1.compareTo(order2);
  }
}
Program: 107906
Project: 107906
Buggy source:
/** 
 * Orders the given array by the given sort order.
 * @param array
 * @param order
 */
private void sort(final String[] array,final Map<String,Integer> order){
  GenericSorting.mergeSort(0,array.length,new IntComparator(){
    @Override public int compare(    int arg0,    int arg1){
      checkInterrupt();
      Integer order1=order.get(array[arg0]);
      Integer order2=order.get(array[arg1]);
      if (order1 == null || order2 == null) {
        throw new RuntimeException("String_Node_Str");
      }
 else {
        return order1.compareTo(order2);
      }
    }
  }
,new Swapper(){
    @Override public void swap(    int arg0,    int arg1){
      String temp=array[arg0];
      array[arg0]=array[arg1];
      array[arg1]=temp;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Orders the given array by the given sort order.
 * @param array
 * @param order
 */
private void sort(final String[] array,final Map<String,Integer> order){
  GenericSorting.mergeSort(0,array.length,new IntComparator(){
    @Override public int compare(    int arg0,    int arg1){
      checkInterrupt();
      Integer order1=order.get(array[arg0]);
      Integer order2=order.get(array[arg1]);
      if (order1 == null || order2 == null) {
        String message="String_Node_Str";
        message+=order1 == null ? "String_Node_Str" + array[arg0] + "String_Node_Str" : "String_Node_Str";
        message+=order2 == null ? "String_Node_Str" + array[arg1] + "String_Node_Str" : "String_Node_Str";
        throw new RuntimeException(message);
      }
 else {
        return order1.compareTo(order2);
      }
    }
  }
,new Swapper(){
    @Override public void swap(    int arg0,    int arg1){
      String temp=array[arg0];
      array[arg0]=array[arg1];
      array[arg1]=temp;
    }
  }
);
}
Program: 107907
Project: 107907
Buggy source:
/** 
 * Creates a new instance. Min is inclusive, max is exclusive
 * @param builder
 * @param type
 * @param min
 * @param max
 * @param function
 */
private Interval(HierarchyBuilderGroupingBased<T> builder,DataType<T> type,T min,T max,AggregateFunction<T> function){
  super(function.aggregate(new String[]{type.format(min),type.format(max)}));
  this.builder=builder;
  this.min=min;
  this.max=max;
  this.function=function;
  this.lower=false;
}

Fixed version (ground truth):
/** 
 * Creates a new instance. Min is inclusive, max is exclusive
 * @param builder
 * @param type
 * @param min
 * @param max
 * @param function
 */
private Interval(HierarchyBuilderGroupingBased<T> builder,DataType<T> type,T min,T max,AggregateFunction<T> function){
  super(function.aggregate(new String[]{type.format(min),type.format(max)}));
  this.builder=builder;
  this.min=min;
  this.max=max;
  this.function=function;
  this.lower=null;
}
Program: 107909
Project: 107909
Buggy source:
@Override public int compare(int arg0,int arg1){
  checkInterrupt();
  Integer order1=order.get(array[arg0]);
  Integer order2=order.get(array[arg1]);
  if (order1 == null || order2 == null) {
    throw new RuntimeException("String_Node_Str");
  }
 else {
    return order1.compareTo(order2);
  }
}

Fixed version (ground truth):
@Override public int compare(int arg0,int arg1){
  checkInterrupt();
  Integer order1=order.get(array[arg0]);
  Integer order2=order.get(array[arg1]);
  if (order1 == null || order2 == null) {
    String message="String_Node_Str";
    message+=order1 == null ? "String_Node_Str" + array[arg0] + "String_Node_Str" : "String_Node_Str";
    message+=order2 == null ? "String_Node_Str" + array[arg1] + "String_Node_Str" : "String_Node_Str";
    throw new RuntimeException(message);
  }
 else {
    return order1.compareTo(order2);
  }
}
Program: 107911
Project: 107911
Buggy source:
/** 
 * Orders the given array by the given sort order.
 * @param array
 * @param order
 */
private void sort(final String[] array,final Map<String,Integer> order){
  GenericSorting.mergeSort(0,array.length,new IntComparator(){
    @Override public int compare(    int arg0,    int arg1){
      checkInterrupt();
      Integer order1=order.get(array[arg0]);
      Integer order2=order.get(array[arg1]);
      if (order1 == null || order2 == null) {
        throw new RuntimeException("String_Node_Str");
      }
 else {
        return order1.compareTo(order2);
      }
    }
  }
,new Swapper(){
    @Override public void swap(    int arg0,    int arg1){
      String temp=array[arg0];
      array[arg0]=array[arg1];
      array[arg1]=temp;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Orders the given array by the given sort order.
 * @param array
 * @param order
 */
private void sort(final String[] array,final Map<String,Integer> order){
  GenericSorting.mergeSort(0,array.length,new IntComparator(){
    @Override public int compare(    int arg0,    int arg1){
      checkInterrupt();
      Integer order1=order.get(array[arg0]);
      Integer order2=order.get(array[arg1]);
      if (order1 == null || order2 == null) {
        String message="String_Node_Str";
        message+=order1 == null ? "String_Node_Str" + array[arg0] + "String_Node_Str" : "String_Node_Str";
        message+=order2 == null ? "String_Node_Str" + array[arg1] + "String_Node_Str" : "String_Node_Str";
        throw new RuntimeException(message);
      }
 else {
        return order1.compareTo(order2);
      }
    }
  }
,new Swapper(){
    @Override public void swap(    int arg0,    int arg1){
      String temp=array[arg0];
      array[arg0]=array[arg1];
      array[arg1]=temp;
    }
  }
);
}
Program: 107914
Project: 107914
Buggy source:
/** 
 * @param rowIndex
 */
public void add(int rowIndex){
  int offset=rowIndex >> ADDRESS_BITS_PER_UNIT;
  long temp=array[offset];
  this.array[offset]|=1L << (rowIndex & BIT_INDEX_MASK);
  this.size+=array[offset] != temp ? 1 : 0;
}

Fixed version (ground truth):
/** 
 * Sets a bit
 * @param rowIndex
 */
public void add(int rowIndex){
  int offset=rowIndex >> ADDRESS_BITS_PER_UNIT;
  long temp=array[offset];
  this.array[offset]|=1L << (rowIndex & BIT_INDEX_MASK);
  this.size+=array[offset] != temp ? 1 : 0;
}
Program: 107915
Project: 107915
Buggy source:
/** 
 * @param rowIndex
 * @return
 */
public boolean contains(int rowIndex){
  return ((array[rowIndex >> ADDRESS_BITS_PER_UNIT] & (1L << (rowIndex & BIT_INDEX_MASK))) != 0);
}

Fixed version (ground truth):
/** 
 * Checks whether the bit is set
 * @param rowIndex
 * @return
 */
public boolean contains(int rowIndex){
  return ((array[rowIndex >> ADDRESS_BITS_PER_UNIT] & (1L << (rowIndex & BIT_INDEX_MASK))) != 0);
}
Program: 107916
Project: 107916
Buggy source:
/** 
 * @return
 */
public int size(){
  return this.size;
}

Fixed version (ground truth):
/** 
 * Returns the number of bits set
 * @return
 */
public int size(){
  return this.size;
}
Program: 107917
Project: 107917
Buggy source:
/** 
 * @param rowIndex1
 * @param rowIndex2
 */
public void swap(int rowIndex1,int rowIndex2){
  final boolean temp1=contains(rowIndex1);
  final boolean temp2=contains(rowIndex2);
  if (temp2) {
    add(rowIndex1);
  }
 else {
    remove(rowIndex1);
  }
  if (temp1) {
    add(rowIndex2);
  }
 else {
    remove(rowIndex2);
  }
}

Fixed version (ground truth):
/** 
 * Swaps two bits
 * @param rowIndex1
 * @param rowIndex2
 */
public void swap(int rowIndex1,int rowIndex2){
  final boolean temp1=contains(rowIndex1);
  final boolean temp2=contains(rowIndex2);
  if (temp2) {
    add(rowIndex1);
  }
 else {
    remove(rowIndex1);
  }
  if (temp1) {
    add(rowIndex2);
  }
 else {
    remove(rowIndex2);
  }
}
Program: 107918
Project: 107918
Buggy source:
/** 
 * @param length
 */
private RowSet(int length){
  this.length=length;
  int chunks=(int)(Math.ceil((double)this.length / 64d));
  this.array=new long[chunks];
}

Fixed version (ground truth):
/** 
 * Creates a new instance
 * @param length
 */
private RowSet(int length){
  this.length=length;
  int chunks=(int)(Math.ceil((double)this.length / 64d));
  this.array=new long[chunks];
}
Program: 107919
Project: 107919
Buggy source:
/** 
 * @return
 */
public int length(){
  return this.length;
}

Fixed version (ground truth):
/** 
 * Returns the number of available bits
 * @return
 */
public int length(){
  return this.length;
}
Program: 107920
Project: 107920
Buggy source:
/** 
 * @param rowIndex
 */
public void remove(int rowIndex){
  int offset=rowIndex >> ADDRESS_BITS_PER_UNIT;
  long temp=array[offset];
  this.array[offset]&=~(1L << (rowIndex & BIT_INDEX_MASK));
  this.size-=array[offset] != temp ? 1 : 0;
}

Fixed version (ground truth):
/** 
 * Unsets a bit
 * @param rowIndex
 */
public void remove(int rowIndex){
  int offset=rowIndex >> ADDRESS_BITS_PER_UNIT;
  long temp=array[offset];
  this.array[offset]&=~(1L << (rowIndex & BIT_INDEX_MASK));
  this.size-=array[offset] != temp ? 1 : 0;
}
Program: 107921
Project: 107921
Buggy source:
/** 
 * Adds a privacy model to the configuration.
 * @param c
 * @return
 */
public ARXConfiguration addPrivacyModel(PrivacyCriterion c){
  checkArgument(c);
  if ((c instanceof DPresence) && this.isPrivacyModelSpecified(DPresence.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if ((c instanceof KMap) && this.isPrivacyModelSpecified(KMap.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if ((c instanceof KAnonymity) && this.isPrivacyModelSpecified(KAnonymity.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if ((c instanceof EDDifferentialPrivacy) && this.isPrivacyModelSpecified(EDDifferentialPrivacy.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if (c.isSubsetAvailable()) {
    List<int[]> subsets=new ArrayList<int[]>();
    subsets.add(c.getDataSubset().getArray());
    for (    PrivacyCriterion other : this.getPrivacyModels()) {
      if (other.isSubsetAvailable()) {
        subsets.add(other.getDataSubset().getArray());
      }
    }
    for (int i=0; i < subsets.size() - 1; i++) {
      if (!Arrays.equals(subsets.get(i),subsets.get(i + 1))) {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  criteria.add(c);
  if (this.isPrivacyModelSpecified(EDDifferentialPrivacy.class)) {
    for (    PrivacyCriterion other : this.getPrivacyModels()) {
      if (other != c && other.isSubsetAvailable()) {
        criteria.remove(c);
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Adds a privacy model to the configuration.
 * @param c
 * @return
 */
public ARXConfiguration addPrivacyModel(PrivacyCriterion c){
  checkArgument(c);
  if ((c instanceof DPresence) && this.isPrivacyModelSpecified(DPresence.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if ((c instanceof KMap) && this.isPrivacyModelSpecified(KMap.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if ((c instanceof KAnonymity) && this.isPrivacyModelSpecified(KAnonymity.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if ((c instanceof EDDifferentialPrivacy) && this.isPrivacyModelSpecified(EDDifferentialPrivacy.class)) {
    throw new RuntimeException("String_Node_Str");
  }
  if (c.isSubsetAvailable()) {
    List<int[]> subsets=new ArrayList<int[]>();
    subsets.add(c.getDataSubset().getArray());
    for (    PrivacyCriterion other : this.getPrivacyModels()) {
      if (other.isSubsetAvailable()) {
        subsets.add(other.getDataSubset().getArray());
      }
    }
    for (int i=0; i < subsets.size() - 1; i++) {
      if (!Arrays.equals(subsets.get(i),subsets.get(i + 1))) {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
  }
  criteria.add(c);
  if (this.isPrivacyModelSpecified(EDDifferentialPrivacy.class)) {
    for (    PrivacyCriterion other : this.getPrivacyModels()) {
      if (!(other instanceof EDDifferentialPrivacy) && other.isSubsetAvailable()) {
        criteria.remove(c);
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
  return this;
}
Program: 107922
Project: 107922
Buggy source:
/** 
 * This will return the normalized numer of aggregated values in range [1/#distinct-values, 1].
 * @param distribution
 * @return
 */
public <T>double getInformationLoss(Distribution distribution){
  double result=0d;
  int[] buckets=distribution.getBuckets();
  for (int i=0; i < buckets.length; i+=2) {
    result+=buckets[i] != -1 ? 1 : 0;
  }
  return result / (double)hierarchy.length;
}

Fixed version (ground truth):
/** 
 * This will return the normalized numer of aggregated values in range [1/#distinct-values, 1].
 * @param distribution
 * @return
 */
public <T>double getInformationLoss(Distribution distribution){
  double result=0d;
  int[] buckets=distribution.getBuckets();
  for (int i=0; i < buckets.length; i+=2) {
    result+=buckets[i] != -1 ? 1 : 0;
  }
  return result / (double)dictionary.length;
}
Program: 107924
Project: 107924
Buggy source:
/** 
 * Creates a new instance of this page and sets its title and description.
 * @param wizardImport Reference to wizard containing this page
 */
public ImportWizardPageTable(ImportWizard wizardImport){
  super("String_Node_Str");
  this.wizardImport=wizardImport;
  setTitle(Resources.getMessage("String_Node_Str"));
  setDescription(Resources.getMessage("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Creates a new instance of this page and sets its title and description.
 * @param wizardImport Reference to wizard containing this page
 */
public ImportWizardPageTable(ImportWizard wizardImport){
  super("String_Node_Str");
  this.wizardImport=wizardImport;
  this.setTitle(Resources.getMessage("String_Node_Str"));
  this.setDescription(Resources.getMessage("String_Node_Str"));
}
Program: 107925
Project: 107925
Buggy source:
/** 
 * Reads in the preview data for currently selected table If this can be performed successful, the preview data will be made available for the following pages by   {@link ImportWizardModel#setPreviewData(List)}. Otherwise an appropriate error message is set.
 */
protected void readPreview(){
  String selectedTable=wizardImport.getData().getSelectedJdbcTable();
  List<String[]> previewData=new ArrayList<String[]>();
  Connection connection=wizardImport.getData().getJdbcConnection();
  Statement statement=null;
  ResultSet rs=null;
  try {
    statement=connection.createStatement();
    statement.setMaxRows(ImportWizardModel.PREVIEW_MAX_LINES);
    statement.execute("String_Node_Str" + selectedTable);
    rs=statement.getResultSet();
    while (rs.next()) {
      String[] previewRow=new String[rs.getMetaData().getColumnCount()];
      for (int j=0; j < previewRow.length; j++) {
        previewRow[j]=IOUtil.trim(rs.getString(j + 1));
      }
      previewData.add(previewRow);
    }
  }
 catch (  SQLException e) {
    setErrorMessage(Resources.getMessage("String_Node_Str"));
  }
 finally {
    try {
      if (rs != null) {
        rs.close();
      }
    }
 catch (    SQLException e) {
    }
    try {
      if (statement != null) {
        statement.close();
      }
    }
 catch (    SQLException e) {
    }
  }
  wizardImport.getData().setPreviewData(previewData);
}

Fixed version (ground truth):
/** 
 * Reads in the preview data for currently selected table If this can be performed successful, the preview data will be made available for the following pages by   {@link ImportWizardModel#setPreviewData(List)}. Otherwise an appropriate error message is set.
 */
private boolean readPreview(){
  String selectedTable=wizardImport.getData().getSelectedJdbcTable();
  Connection connection=wizardImport.getData().getJdbcConnection();
  Statement statement=null;
  ResultSet rs=null;
  try {
    statement=connection.createStatement();
    statement.setMaxRows(ImportWizardModel.PREVIEW_MAX_LINES);
    statement.execute("String_Node_Str" + selectedTable);
    rs=statement.getResultSet();
    List<String[]> previewData=new ArrayList<String[]>();
    while (rs.next()) {
      String[] previewRow=new String[rs.getMetaData().getColumnCount()];
      for (int j=0; j < previewRow.length; j++) {
        previewRow[j]=IOUtil.trim(rs.getString(j + 1));
      }
      previewData.add(previewRow);
    }
    wizardImport.getData().setPreviewData(previewData);
    return true;
  }
 catch (  SQLException e) {
    setErrorMessage(Resources.getMessage("String_Node_Str"));
  }
 finally {
    try {
      if (rs != null) {
        rs.close();
      }
    }
 catch (    SQLException e) {
    }
    try {
      if (statement != null) {
        statement.close();
      }
    }
 catch (    SQLException e) {
    }
  }
  wizardImport.getData().setPreviewData(new ArrayList<String[]>());
  return false;
}
Program: 107926
Project: 107926
Buggy source:
/** 
 * Reads in the columns and preview data for selected table
 */
@Override public void selectionChanged(SelectionChangedEvent arg0){
  int index=table.getSelectionIndex();
  String selectedTable=wizardImport.getData().getJdbcTables().get(index);
  wizardImport.getData().setSelectedJdbcTable(selectedTable);
  readColumns();
  readPreview();
  setPageComplete(true);
}

Fixed version (ground truth):
/** 
 * Reads in the columns and preview data for selected table
 */
@Override public void selectionChanged(SelectionChangedEvent arg0){
  int index=table.getSelectionIndex();
  String selectedTable=wizardImport.getData().getJdbcTables().get(index);
  wizardImport.getData().setSelectedJdbcTable(selectedTable);
  readColumns();
  setPageComplete(readPreview());
}
Program: 107927
Project: 107927
Buggy source:
/** 
 * Returns number of rows for table If the number of rows couldn't be determined, three question marks are returned.
 */
@Override public String getText(Object element){
  long rows=getNumberOfRows((String)element);
  if (rows != -1) {
    return "String_Node_Str" + humanReadableRowCount(rows);
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Returns number of rows for table If the number of rows couldn't be determined, three question marks are returned.
 */
@Override public String getText(Object element){
  long rows=getNumberOfRows((String)element);
  if (rows != -1) {
    return "String_Node_Str" + getHumanReadableCount(rows);
  }
 else {
    return "String_Node_Str";
  }
}