nus-yam/ex-repair huggingface dataset:
Program: 108855
Project: 108855
Buggy source:
@Override public void run(){
  final long time=System.currentTimeMillis();
  while (!stop && ((System.currentTimeMillis() - time) < 1000)) {
    if ((in != null) && (out != null)) {
      try {
        if (Display.getCurrent() != null) {
          runnable.run();
        }
 else {
          Display.getDefault().syncExec(runnable);
        }
      }
 catch (      final Exception e) {
      }
    }
    try {
      Thread.sleep(10);
    }
 catch (    final InterruptedException e) {
    }
  }
  synchronizer=null;
synchronized (LayoutAnalyze.this) {
    LayoutAnalyze.this.notify();
  }
}

Fixed version (ground truth):
@Override public void run(){
  final long time=System.currentTimeMillis();
  while (!stop && ((System.currentTimeMillis() - time) < 1000)) {
    if ((in != null) && (out != null)) {
      try {
        if (Display.getCurrent() != null) {
          runnable.run();
        }
 else {
          Display.getDefault().syncExec(runnable);
        }
      }
 catch (      final Exception e) {
      }
    }
    try {
      Thread.sleep(10);
    }
 catch (    final InterruptedException e) {
    }
  }
  synchronizer=null;
synchronized (monitor) {
    monitor.notify();
  }
}
Program: 108857
Project: 108857
Buggy source:
/** 
 * Redraws the plot
 */
private void redraw(){
  if (model != null && model.getAttributePair() != null & model.getAttributePair()[0] != null && model.getAttributePair()[1] != null) {
    final DataHandle data=getData();
    if (data == null) {
      reset();
      return;
    }
    final int index1=data.getColumnIndexOf(model.getAttributePair()[0]);
    final int index2=data.getColumnIndexOf(model.getAttributePair()[1]);
    if (index1 < 0 || index2 < 0) {
      reset();
      return;
    }
    attribute1=model.getAttributePair()[0];
    attribute2=model.getAttributePair()[1];
    handle=data;
    updateData();
    updatePlot();
    repaint();
  }
 else {
    reset();
    return;
  }
}

Fixed version (ground truth):
/** 
 * Redraws the plot
 */
private void redraw(){
  if (model != null && model.getAttributePair() != null && model.getAttributePair()[0] != null && model.getAttributePair()[1] != null) {
    final DataHandle data=getData();
    if (data == null) {
      reset();
      return;
    }
    final int index1=data.getColumnIndexOf(model.getAttributePair()[0]);
    final int index2=data.getColumnIndexOf(model.getAttributePair()[1]);
    if (index1 < 0 || index2 < 0) {
      reset();
      return;
    }
    attribute1=model.getAttributePair()[0];
    attribute2=model.getAttributePair()[1];
    handle=data;
    updateData();
    updatePlot();
    repaint();
  }
 else {
    reset();
    return;
  }
}
Program: 108858
Project: 108858
Buggy source:
/** 
 * Lists all available data types
 * @return
 */
private static List<DataTypeDescription<?>> listDataTypes(){
  List<DataTypeDescription<?>> list=new ArrayList<DataTypeDescription<?>>();
  list.add(STRING.getDescription());
  list.add(DATE.getDescription());
  list.add(DECIMAL.getDescription());
  list.add(INTEGER.getDescription());
  return list;
}

Fixed version (ground truth):
/** 
 * Lists all available data types
 * @return
 */
private static final List<DataTypeDescription<?>> listDataTypes(){
  List<DataTypeDescription<?>> list=new ArrayList<DataTypeDescription<?>>();
  list.add(STRING.getDescription());
  list.add(DATE.getDescription());
  list.add(DECIMAL.getDescription());
  list.add(INTEGER.getDescription());
  return list;
}
Program: 108860
Project: 108860
Buggy source:
@Test public void testExample14(){
  try {
    Example12.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testExample14(){
  try {
    Example14.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 108861
Project: 108861
Buggy source:
@Test public void testExample13(){
  try {
    Example12.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testExample13(){
  try {
    Example13.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 108862
Project: 108862
Buggy source:
@Test public void testExample16(){
  try {
    Example12.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testExample16(){
  try {
    Example16.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 108863
Project: 108863
Buggy source:
@Test public void testExample15(){
  try {
    Example12.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testExample15(){
  try {
    Example15.main(null);
  }
 catch (  final Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 108865
Project: 108865
Buggy source:
/** 
 * @param xlsSheetIndex {@link #xlsSheetIndex}
 */
public void setXlsSheetIndex(int xlsSheetIndex){
  this.xlsSheetIndex=xlsSheetIndex;
}

Fixed version (ground truth):
/** 
 * @param {@link #xlsSheetIndex}
 */
public void setXlsSheetIndex(int xlsSheetIndex){
  this.xlsSheetIndex=xlsSheetIndex;
}
Program: 108868
Project: 108868
Buggy source:
/** 
 * Returns the data handle
 * @return
 */
protected DataHandle getHandle(){
  if (model != null) {
    if (target == ModelPart.INPUT) {
      DataHandle handle=model.getInputConfig().getInput().getHandle();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
 else {
      DataHandle handle=model.getOutput();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the data handle
 * @return
 */
protected DataHandle getHandle(){
  DataHandle handle=null;
  if (model != null) {
    if (target == ModelPart.INPUT) {
      handle=model.getInputConfig().getInput().getHandle();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
 else {
      handle=model.getOutput();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
  }
 else {
    return null;
  }
}
Program: 108869
Project: 108869
Buggy source:
public static void main(final String[] args){
  try {
    if (!isOSX()) {
      splash=new MainSplash();
      splash.setVisible(true);
    }
 else {
      try {
        Class.forName(JDK16_FRAME);
      }
 catch (      Exception e) {
        SWT_AWT.embeddedFrameClass=JDK17_FRAME;
      }
    }
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    hideSplash();
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  try {
    if (!isOSX()) {
      splash=new MainSplash();
      splash.setVisible(true);
    }
 else {
      try {
        Class.forName(JDK16_FRAME);
      }
 catch (      Exception e) {
        SWT_AWT.embeddedFrameClass=JDK17_FRAME;
      }
    }
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.addListener(SWT.Show,new Listener(){
      @Override public void handleEvent(      Event arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    hideSplash();
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}
Program: 108872
Project: 108872
Buggy source:
/** 
 * Returns the data handle
 * @return
 */
protected DataHandle getHandle(){
  if (model != null) {
    if (target == ModelPart.INPUT) {
      DataHandle handle=model.getInputConfig().getInput().getHandle();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
 else {
      DataHandle handle=model.getOutput();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the data handle
 * @return
 */
protected DataHandle getHandle(){
  DataHandle handle=null;
  if (model != null) {
    if (target == ModelPart.INPUT) {
      handle=model.getInputConfig().getInput().getHandle();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
 else {
      handle=model.getOutput();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
  }
 else {
    return null;
  }
}
Program: 108873
Project: 108873
Buggy source:
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  final GridLayout l=new GridLayout();
  l.numColumns=2;
  parent.setLayout(l);
  table=new Table(parent,SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
  GridData d=SWTUtil.createFillGridData();
  d.horizontalSpan=2;
  d.grabExcessHorizontalSpace=true;
  d.grabExcessVerticalSpace=true;
  table.setLayoutData(d);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  try {
    detect(file);
    read(file);
  }
 catch (  final Exception e) {
    controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
    close();
  }
  final Combo combo=new Combo(parent,SWT.NONE);
  d=SWTUtil.createFillHorizontallyGridData();
  d.horizontalSpan=2;
  combo.setLayoutData(d);
  for (  final String s : labels) {
    combo.add(s);
  }
  combo.select(selection);
  combo.pack();
  combo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      try {
        if (combo.getSelectionIndex() == -1) {
          return;
        }
        selection=combo.getSelectionIndex();
        read(file);
      }
 catch (      final Exception e) {
        controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
        close();
      }
    }
  }
);
  return parent;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  final GridLayout l=new GridLayout();
  l.numColumns=2;
  parent.setLayout(l);
  table=new Table(parent,SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
  GridData d=SWTUtil.createFillGridData();
  d.horizontalSpan=2;
  d.grabExcessHorizontalSpace=true;
  d.grabExcessVerticalSpace=true;
  table.setLayoutData(d);
  table.setHeaderVisible(true);
  table.setLinesVisible(true);
  try {
    detect(file);
    read(file);
  }
 catch (  final Exception e) {
    controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
    close();
    return parent;
  }
  final Combo combo=new Combo(parent,SWT.NONE);
  d=SWTUtil.createFillHorizontallyGridData();
  d.horizontalSpan=2;
  combo.setLayoutData(d);
  for (  final String s : labels) {
    combo.add(s);
  }
  combo.select(selection);
  combo.pack();
  combo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      try {
        if (combo.getSelectionIndex() == -1) {
          return;
        }
        selection=combo.getSelectionIndex();
        read(file);
      }
 catch (      final Exception e) {
        controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
        close();
      }
    }
  }
);
  return parent;
}
Program: 108874
Project: 108874
Buggy source:
/** 
 * Returns the data handle
 * @return
 */
protected DataHandle getHandle(){
  if (model != null) {
    if (target == ModelPart.INPUT) {
      DataHandle handle=model.getInputConfig().getInput().getHandle();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null) {
        handle=handle.getView();
      }
      return handle;
    }
 else {
      DataHandle handle=model.getOutput();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null) {
        handle=handle.getView();
      }
      return handle;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the data handle
 * @return
 */
protected DataHandle getHandle(){
  if (model != null) {
    if (target == ModelPart.INPUT) {
      DataHandle handle=model.getInputConfig().getInput().getHandle();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
 else {
      DataHandle handle=model.getOutput();
      if (model.getViewConfig().isSubset() && model.getOutputConfig() != null && model.getOutputConfig().getConfig() != null && handle != null) {
        handle=handle.getView();
      }
      return handle;
    }
  }
 else {
    return null;
  }
}
Program: 108875
Project: 108875
Buggy source:
/** 
 * Column selection event
 * @param arg1
 */
protected void actionColumnSelected(ColumnSelectionEvent arg1){
  if (model != null) {
    int column=arg1.getColumnPositionRanges().iterator().next().start - 1;
    if (column >= 0) {
      DataHandle handle=getHandle();
      if (handle != null) {
        final String attr=handle.getAttributeName(column);
        table.setAttribute(attr);
        table.redraw();
        model.setSelectedAttribute(attr);
        controller.update(new ModelEvent(this,ModelPart.SELECTED_ATTRIBUTE,attr));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Selects the given column
 * @param index
 */
private void actionColumnSelected(int index){
  DataHandle handle=getHandle();
  if (handle != null) {
    final String attr=handle.getAttributeName(index);
    model.setSelectedAttribute(attr);
    table.setSelectedAttribute(attr);
    controller.update(new ModelEvent(this,ModelPart.SELECTED_ATTRIBUTE,attr));
  }
}
Program: 108876
Project: 108876
Buggy source:
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.OUTPUT || event.part == ModelPart.INPUT || event.part == ModelPart.VIEW_CONFIG) {
    if (model != null && model.getOutput() != null) {
      groupsButton.setEnabled(true);
      subsetButton.setEnabled(true);
    }
 else {
      groupsButton.setEnabled(false);
      subsetButton.setEnabled(false);
    }
  }
  if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
    reset();
  }
  if (event.part == ModelPart.VIEW_CONFIG) {
    subsetButton.setSelection(model.getViewConfig().isSubset());
  }
}

Fixed version (ground truth):
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.OUTPUT || event.part == ModelPart.INPUT || event.part == ModelPart.VIEW_CONFIG) {
    if (model != null && model.getOutput() != null) {
      groupsButton.setEnabled(true);
      subsetButton.setEnabled(true);
    }
 else {
      groupsButton.setEnabled(false);
      subsetButton.setEnabled(false);
    }
  }
  if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
    reset();
  }
  if (event.part == ModelPart.VIEW_CONFIG) {
    subsetButton.setSelection(model.getViewConfig().isSubset());
  }
  if (event.part == ModelPart.SELECTED_ATTRIBUTE) {
    table.setSelectedAttribute((String)event.data);
  }
}
Program: 108877
Project: 108877
Buggy source:
/** 
 * Cell selection event
 * @param arg1
 */
protected abstract void actionCellSelected(CellSelectionEvent arg1);

Fixed version (ground truth):
/** 
 * Cell selection event
 * @param arg1
 */
protected void actionCellSelected(CellSelectionEvent arg1){
  if (model != null) {
    int column=arg1.getColumnPosition() - 1;
    if (column >= 0)     actionColumnSelected(column);
  }
}
Program: 108878
Project: 108878
Buggy source:
@Override protected void actionCellSelected(CellSelectionEvent arg1){
  if (model == null)   return;
  int column=arg1.getColumnPosition();
  int row=arg1.getRowPosition();
  if (column == 0 && row >= 0) {
    if (table.getData() instanceof DataHandleSubset) {
      int[] subset=((DataHandleSubset)table.getData()).getSubset();
      row=subset[row];
    }
    RowSet subset=model.getInputConfig().getResearchSubset();
    if (subset.contains(row)) {
      subset.remove(row);
    }
 else {
      subset.add(row);
    }
    model.setSubsetManual();
    controller.update(new ModelEvent(this,ModelPart.RESEARCH_SUBSET,subset));
  }
}

Fixed version (ground truth):
@Override protected void actionCellSelected(CellSelectionEvent arg1){
  super.actionCellSelected(arg1);
  if (model == null)   return;
  int column=arg1.getColumnPosition();
  int row=arg1.getRowPosition();
  if (column == 0 && row >= 0) {
    if (table.getData() instanceof DataHandleSubset) {
      int[] subset=((DataHandleSubset)table.getData()).getSubset();
      row=subset[row];
    }
    RowSet subset=model.getInputConfig().getResearchSubset();
    if (subset.contains(row)) {
      subset.remove(row);
    }
 else {
      subset.add(row);
    }
    model.setSubsetManual();
    controller.update(new ModelEvent(this,ModelPart.RESEARCH_SUBSET,subset));
  }
}
Program: 108879
Project: 108879
Buggy source:
@Override protected void actionCellSelected(CellSelectionEvent arg1){
}

Fixed version (ground truth):
@Override protected void actionCellSelected(CellSelectionEvent arg1){
  super.actionCellSelected(arg1);
}
Program: 108880
Project: 108880
Buggy source:
/** 
 * This is a dirty hack to push the hierarchies into the definition. It is triggered by a change event on the attribute type 
 */
private void pushHierarchy(){
  updateMinAndMax();
  if (model == null) {
    return;
  }
  final DataDefinition definition=model.getInputConfig().getInput().getDefinition();
  final Hierarchy h=Hierarchy.create(hierarchy);
  if (definition.getAttributeType(attribute) instanceof Hierarchy) {
    model.getInputConfig().getInput().getDefinition().setAttributeType(attribute,h);
    controller.update(new ModelEvent(this,ModelPart.ATTRIBUTE_TYPE,attribute));
  }
  if (definition.getAttributeType(attribute) == AttributeType.SENSITIVE_ATTRIBUTE) {
    model.getInputConfig().setHierarchy(attribute,h);
    controller.update(new ModelEvent(this,ModelPart.ATTRIBUTE_TYPE,attribute));
  }
}

Fixed version (ground truth):
/** 
 * TODO: This is a dirty hack to push the hierarchies into the definition. It is triggered by a change event on the attribute type 
 */
private void pushHierarchy(){
  updateMinAndMax();
  if (model == null) {
    return;
  }
  final DataDefinition definition=model.getInputConfig().getInput().getDefinition();
  final Hierarchy h=Hierarchy.create(hierarchy);
  if (definition.getAttributeType(attribute) instanceof Hierarchy) {
    model.getInputConfig().getInput().getDefinition().setAttributeType(attribute,h);
    updateMin();
    updateMax();
    controller.update(new ModelEvent(this,ModelPart.ATTRIBUTE_TYPE,attribute));
  }
  if (definition.getAttributeType(attribute) == AttributeType.SENSITIVE_ATTRIBUTE) {
    model.getInputConfig().setHierarchy(attribute,h);
    controller.update(new ModelEvent(this,ModelPart.ATTRIBUTE_TYPE,attribute));
  }
}
Program: 108882
Project: 108882
Buggy source:
/** 
 * Reds the first few files with chosen separator
 * @param file
 * @return
 * @throws IOException
 */
private void read(final String file) throws IOException {
  final CSVDataInput in=new CSVDataInput(file,separators[selection]);
  final Iterator<String[]> it=in.iterator();
  final List<String[]> data=new ArrayList<String[]>();
  int count=0;
  while (it.hasNext() && (count < LINES)) {
    data.add(it.next());
    count++;
  }
  in.close();
  if (!this.data) {
    data.add(data.get(data.size() - 1));
    for (int i=data.size() - 2; i >= 0; i--) {
      data.set(i + 1,data.get(i));
    }
    int length=data.get(0).length;
    String[] header=new String[length];
    for (int i=0; i < length; i++) {
      header[i]=Resources.getMessage("String_Node_Str") + (i + 1);
    }
    data.set(0,header);
  }
  table.setRedraw(false);
  table.removeAll();
  for (  final TableColumn c : columns) {
    c.dispose();
  }
  columns.clear();
  if (data.size() == 0) {
    return;
  }
  for (  final String s : data.get(0)) {
    final TableColumn c=new TableColumn(table,SWT.NONE);
    c.setText(s);
    columns.add(c);
    c.pack();
  }
  for (int i=1; i < data.size(); i++) {
    final TableItem item=new TableItem(table,SWT.NONE);
    for (int j=0; j < data.get(i).length; j++) {
      item.setText(j,data.get(i)[j]);
    }
  }
  table.setRedraw(true);
  table.redraw();
}

Fixed version (ground truth):
/** 
 * Reds the first few files with chosen separator
 * @param file
 * @return
 * @throws IOException
 */
private void read(final String file) throws IOException {
  final CSVDataInput in=new CSVDataInput(file,separators[selection]);
  final Iterator<String[]> it=in.iterator();
  final List<String[]> data=new ArrayList<String[]>();
  int count=0;
  while (it.hasNext() && (count < LINES)) {
    data.add(it.next());
    count++;
  }
  in.close();
  if (!this.data && data.size() > 0) {
    data.add(data.get(data.size() - 1));
    for (int i=data.size() - 2; i >= 0; i--) {
      data.set(i + 1,data.get(i));
    }
    int length=data.get(0).length;
    String[] header=new String[length];
    for (int i=0; i < length; i++) {
      header[i]=Resources.getMessage("String_Node_Str") + (i + 1);
    }
    data.set(0,header);
  }
  table.setRedraw(false);
  table.removeAll();
  for (  final TableColumn c : columns) {
    c.dispose();
  }
  columns.clear();
  if (data.size() == 0) {
    return;
  }
  for (  final String s : data.get(0)) {
    final TableColumn c=new TableColumn(table,SWT.NONE);
    c.setText(s);
    columns.add(c);
    c.pack();
  }
  for (int i=1; i < data.size(); i++) {
    final TableItem item=new TableItem(table,SWT.NONE);
    for (int j=0; j < data.get(i).length; j++) {
      item.setText(j,data.get(i)[j]);
    }
  }
  table.setRedraw(true);
  table.redraw();
}
Program: 108883
Project: 108883
Buggy source:
public static void main(final String[] args){
  try {
    if (!isOSX()) {
      splash=new MainSplash();
      splash.setVisible(true);
    }
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    hideSplash();
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  try {
    if (!isOSX()) {
      splash=new MainSplash();
      splash.setVisible(true);
    }
 else {
      try {
        Class.forName(JDK16_FRAME);
      }
 catch (      Exception e) {
        SWT_AWT.embeddedFrameClass=JDK17_FRAME;
      }
    }
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    hideSplash();
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}
Program: 108884
Project: 108884
Buggy source:
public MainSplash() throws IOException {
  this.setSize(new Dimension(400,240));
  this.setLocationRelativeTo(null);
  this.setAlwaysOnTop(true);
  this.setUndecorated(true);
  this.setIconImage(Resources.getImageIcon());
  AWTUtilities.setWindowOpaque(this,false);
  this.addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      repaint();
    }
  }
);
}

Fixed version (ground truth):
public MainSplash() throws IOException {
  this.setSize(new Dimension(400,240));
  this.setLocationRelativeTo(null);
  this.setAlwaysOnTop(true);
  this.setUndecorated(true);
  this.setIconImage(Resources.getImageIcon());
  try {
    AWTUtilities.setWindowOpaque(this,false);
  }
 catch (  Exception e) {
  }
  this.addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      repaint();
    }
  }
);
}
Program: 108885
Project: 108885
Buggy source:
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.INPUT) {
    reset();
  }
 else   if (event.part == ModelPart.RESULT) {
    initialize(model.getResult(),null);
    SWTUtil.enable(root);
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
    reset();
  }
 else   if (event.part == ModelPart.FILTER) {
    if ((filter == null) || (model.getNodeFilter() != filter)) {
      initialize(model.getResult(),model.getNodeFilter());
      SWTUtil.enable(root);
    }
  }
}

Fixed version (ground truth):
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.INPUT) {
    reset();
  }
 else   if (event.part == ModelPart.RESULT) {
    if (model.getResult() == null || model.getResult().getLattice() == null) {
      reset();
      SWTUtil.disable(root);
    }
 else {
      initialize(model.getResult(),null);
      SWTUtil.enable(root);
    }
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
    reset();
  }
 else   if (event.part == ModelPart.FILTER) {
    if ((filter == null) || (model.getNodeFilter() != filter)) {
      if (model.getResult() == null || model.getResult().getLattice() == null) {
        reset();
        SWTUtil.disable(root);
      }
 else {
        initialize(model.getResult(),model.getNodeFilter());
        SWTUtil.enable(root);
      }
    }
  }
}
Program: 108887
Project: 108887
Buggy source:
/** 
 * Resets the view
 */
@Override public void reset(){
  optimum=null;
  selectedNode=null;
  table.setRedraw(false);
  table.clearAll();
  table.setRedraw(true);
}

Fixed version (ground truth):
/** 
 * Resets the view
 */
@Override public void reset(){
  optimum=null;
  selectedNode=null;
  table.setRedraw(false);
  table.clearAll();
  table.setRedraw(true);
  if (listener != null) {
    table.removeListener(SWT.SetData,listener);
  }
}
Program: 108888
Project: 108888
Buggy source:
/** 
 * Updates the list
 * @param result
 * @param filter
 */
private void update(final ARXResult result,final ModelNodeFilter filter){
  controller.getResources().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      table.setRedraw(false);
      table.clearAll();
      list.clear();
      final ARXLattice l=result.getLattice();
      optimum=result.getGlobalOptimum();
      for (      final ARXNode[] level : l.getLevels()) {
        for (        final ARXNode node : level) {
          if (filter.isAllowed(node)) {
            list.add(node);
          }
        }
      }
      Collections.sort(list,new Comparator<ARXNode>(){
        @Override public int compare(        final ARXNode arg0,        final ARXNode arg1){
          return arg0.getMaximumInformationLoss().compareTo(arg1.getMaximumInformationLoss());
        }
      }
);
      if (list.size() > model.getMaxNodesInViewer()) {
        list.clear();
      }
      if (listener != null) {
        table.removeListener(SWT.SetData,listener);
      }
      listener=new Listener(){
        @Override public void handleEvent(        final Event event){
          final TableItem item=(TableItem)event.item;
          final int index=table.indexOf(item);
          createItem(item,index);
        }
      }
;
      table.addListener(SWT.SetData,listener);
      table.setItemCount(list.size());
      table.setRedraw(true);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Updates the list
 * @param result
 * @param filter
 */
private void update(final ARXResult result,final ModelNodeFilter filter){
  if (result == null || result.getLattice() == null)   return;
  if (filter == null)   return;
  controller.getResources().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      table.setRedraw(false);
      table.clearAll();
      list.clear();
      final ARXLattice l=result.getLattice();
      optimum=result.getGlobalOptimum();
      for (      final ARXNode[] level : l.getLevels()) {
        for (        final ARXNode node : level) {
          if (filter.isAllowed(node)) {
            list.add(node);
          }
        }
      }
      Collections.sort(list,new Comparator<ARXNode>(){
        @Override public int compare(        final ARXNode arg0,        final ARXNode arg1){
          return arg0.getMaximumInformationLoss().compareTo(arg1.getMaximumInformationLoss());
        }
      }
);
      if (list.size() > model.getMaxNodesInViewer()) {
        list.clear();
      }
      if (listener != null) {
        table.removeListener(SWT.SetData,listener);
      }
      listener=new Listener(){
        @Override public void handleEvent(        final Event event){
          final TableItem item=(TableItem)event.item;
          final int index=table.indexOf(item);
          createItem(item,index);
        }
      }
;
      table.addListener(SWT.SetData,listener);
      table.setItemCount(list.size());
      table.setRedraw(true);
    }
  }
);
}
Program: 108890
Project: 108890
Buggy source:
/** 
 * File->export data
 */
public void actionMenuFileExportData(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getOutput() == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  if (model.getOutputNode().isAnonymous() != Anonymity.ANONYMOUS) {
    if (!main.showQuestionDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"))) {
      return;
    }
  }
  String file=main.showSaveFileDialog("String_Node_Str");
  if (file == null) {
    return;
  }
  if (!file.endsWith("String_Node_Str")) {
    file=file + "String_Node_Str";
  }
  final WorkerExport worker=new WorkerExport(file,model.getSeparator(),model.getOutput(),model.getOutputConfig().getConfig(),model.getInputBytes());
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + worker.getError().getMessage());
    return;
  }
}

Fixed version (ground truth):
/** 
 * File->export data
 */
public void actionMenuFileExportData(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getOutput() == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  if (model.getOutputNode().isAnonymous() != Anonymity.ANONYMOUS) {
    if (!main.showQuestionDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"))) {
      return;
    }
  }
  String file=main.showSaveFileDialog("String_Node_Str");
  if (file == null) {
    return;
  }
  if (!file.endsWith("String_Node_Str")) {
    file=file + "String_Node_Str";
  }
  final WorkerExport worker=new WorkerExport(file,model.getSeparator(),model.getOutput(),model.getOutputConfig().getConfig(),model.getInputBytes());
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),worker.getError());
    return;
  }
}
Program: 108892
Project: 108892
Buggy source:
/** 
 * Shows an error dialog
 * @param header
 * @param text
 */
public void actionShowErrorDialog(final String header,final String text){
  main.showErrorDialog(header,text);
}

Fixed version (ground truth):
/** 
 * Shows an error dialog
 * @param header
 * @param text
 */
public void actionShowErrorDialog(final String header,final String text,final Throwable t){
  main.showErrorDialog(header,text,t);
}
Program: 108893
Project: 108893
Buggy source:
/** 
 * Internal method for importing hierarchies
 * @param path
 * @param separator
 * @return
 */
private AttributeType actionImportHierarchy(final String path,final char separator){
  try {
    return Hierarchy.create(path,separator);
  }
 catch (  final IOException e) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Internal method for importing hierarchies
 * @param path
 * @param separator
 * @return
 */
private AttributeType actionImportHierarchy(final String path,final char separator){
  try {
    return Hierarchy.create(path,separator);
  }
 catch (  final IOException e) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
  }
  return null;
}
Program: 108894
Project: 108894
Buggy source:
/** 
 * Creates a research subset from a file
 */
public void actionSubsetFile(){
  final String path=actionShowOpenFileDialog("String_Node_Str");
  if (path == null) {
    return;
  }
  final DialogSeparator dialog=new DialogSeparator(main.getShell(),this,path,true);
  dialog.create();
  if (dialog.open() == Window.CANCEL) {
    return;
  }
  final WorkerImport worker=new WorkerImport(path,dialog.getSeparator());
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + worker.getError().getMessage());
    return;
  }
  Data subsetData=worker.getResult();
  Data data=model.getInputConfig().getInput();
  try {
    DataSubset subset=DataSubset.create(data,subsetData);
    model.getInputConfig().setResearchSubset(subset.getSet());
    model.setSubsetOrigin("String_Node_Str");
    update(new ModelEvent(this,ModelPart.RESEARCH_SUBSET,subset.getSet()));
  }
 catch (  IllegalArgumentException e) {
    main.showErrorDialog("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Creates a research subset from a file
 */
public void actionSubsetFile(){
  final String path=actionShowOpenFileDialog("String_Node_Str");
  if (path == null) {
    return;
  }
  final DialogSeparator dialog=new DialogSeparator(main.getShell(),this,path,true);
  dialog.create();
  if (dialog.open() == Window.CANCEL) {
    return;
  }
  final WorkerImport worker=new WorkerImport(path,dialog.getSeparator());
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),worker.getError());
    return;
  }
  Data subsetData=worker.getResult();
  Data data=model.getInputConfig().getInput();
  try {
    DataSubset subset=DataSubset.create(data,subsetData);
    model.getInputConfig().setResearchSubset(subset.getSet());
    model.setSubsetOrigin("String_Node_Str");
    update(new ModelEvent(this,ModelPart.RESEARCH_SUBSET,subset.getSet()));
  }
 catch (  IllegalArgumentException e) {
    main.showErrorDialog("String_Node_Str",e.getMessage(),e);
  }
}
Program: 108895
Project: 108895
Buggy source:
/** 
 * Shows the "about" dialog
 */
public void actionMenuHelpAbout(){
  final DialogAbout dialog=new DialogAbout(main.getShell(),this);
  dialog.create();
  dialog.open();
}

Fixed version (ground truth):
/** 
 * Shows the "about" dialog
 */
public void actionMenuHelpAbout(){
  main.showAboutDialog();
}
Program: 108896
Project: 108896
Buggy source:
/** 
 * Internal method for saving a project
 */
private void actionSaveProject(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  final WorkerSave worker=new WorkerSave(model.getPath(),this,model);
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    getResources().getLogger().info(worker.getError());
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + worker.getError().getMessage());
    return;
  }
}

Fixed version (ground truth):
/** 
 * Internal method for saving a project
 */
private void actionSaveProject(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  final WorkerSave worker=new WorkerSave(model.getPath(),this,model);
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    getResources().getLogger().info(worker.getError());
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),worker.getError());
    return;
  }
}
Program: 108899
Project: 108899
Buggy source:
/** 
 * Applies the selected transformation
 */
public void actionApplySelectedTransformation(){
  final WorkerTransform worker=new WorkerTransform(model);
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    main.showErrorDialog("String_Node_Str",Resources.getMessage("String_Node_Str") + worker.getError().getMessage());
    return;
  }
  if (worker.getResult() != null) {
    this.model.setOutput(worker.getResult(),model.getSelectedNode());
    this.update(new ModelEvent(this,ModelPart.OUTPUT,worker.getResult()));
    this.model.getViewConfig().setMode(Mode.GROUPED);
    this.updateViewConfig(true);
    this.update(new ModelEvent(this,ModelPart.VIEW_CONFIG,model.getOutput()));
  }
}

Fixed version (ground truth):
/** 
 * Applies the selected transformation
 */
public void actionApplySelectedTransformation(){
  final WorkerTransform worker=new WorkerTransform(model);
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    main.showErrorDialog("String_Node_Str",Resources.getMessage("String_Node_Str"),worker.getError());
    return;
  }
  if (worker.getResult() != null) {
    this.model.setOutput(worker.getResult(),model.getSelectedNode());
    this.update(new ModelEvent(this,ModelPart.OUTPUT,worker.getResult()));
    this.model.getViewConfig().setMode(Mode.GROUPED);
    this.updateViewConfig(true);
    this.update(new ModelEvent(this,ModelPart.VIEW_CONFIG,model.getOutput()));
  }
}
Program: 108900
Project: 108900
Buggy source:
/** 
 * File->Export hierarchy
 */
public void actionMenuFileExportHierarchy(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (!(model.isQuasiIdentifierSelected() || model.isSensitiveAttributeSelected())) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  String file=main.showSaveFileDialog("String_Node_Str");
  if (file == null) {
    return;
  }
  if (!file.endsWith("String_Node_Str")) {
    file=file + "String_Node_Str";
  }
  try {
    final CSVDataOutput out=new CSVDataOutput(file,model.getSeparator());
    Hierarchy h=model.getInputConfig().getHierarchy(model.getSelectedAttribute());
    if (h == null) {
      main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    }
 else {
      out.write(h.getHierarchy());
    }
  }
 catch (  final Exception e) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * File->Export hierarchy
 */
public void actionMenuFileExportHierarchy(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (!(model.isQuasiIdentifierSelected() || model.isSensitiveAttributeSelected())) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  String file=main.showSaveFileDialog("String_Node_Str");
  if (file == null) {
    return;
  }
  if (!file.endsWith("String_Node_Str")) {
    file=file + "String_Node_Str";
  }
  try {
    final CSVDataOutput out=new CSVDataOutput(file,model.getSeparator());
    Hierarchy h=model.getInputConfig().getHierarchy(model.getSelectedAttribute());
    if (h == null) {
      main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    }
 else {
      out.write(h.getHierarchy());
    }
  }
 catch (  final Exception e) {
    main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
  }
}
Program: 108901
Project: 108901
Buggy source:
public static void main(final String[] args){
  try {
    splash=new Splash();
    splash.setVisible(true);
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    if (splash != null) {
      hideSplash();
    }
    JOptionPane.showMessageDialog(null,e.getMessage(),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void main(final String[] args){
  try {
    splash=new Splash();
    splash.setVisible(true);
    System.setProperty("String_Node_Str","String_Node_Str");
    MainWindow main=new MainWindow();
    main.addShellListener(new ShellAdapter(){
      @Override public void shellActivated(      ShellEvent arg0){
        hideSplash();
      }
    }
);
    main.show();
  }
 catch (  Throwable e) {
    if (splash != null) {
      hideSplash();
    }
    StringWriter sw=new StringWriter();
    PrintWriter pw=new PrintWriter(sw);
    e.printStackTrace(pw);
    final String trace=sw.toString();
    JOptionPane.showMessageDialog(null,trace,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    System.exit(1);
  }
}
Program: 108903
Project: 108903
Buggy source:
public void show(){
  shell.open();
  while (!shell.isDisposed()) {
    try {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
 catch (    final Exception e) {
      controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + e.getMessage() + Resources.getMessage("String_Node_Str"));
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      e.printStackTrace(pw);
      controller.getResources().getLogger().info(sw.toString());
    }
  }
  display.dispose();
}

Fixed version (ground truth):
public void show(){
  shell.open();
  while (!shell.isDisposed()) {
    try {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
 catch (    final Exception e) {
      controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + Resources.getMessage("String_Node_Str"),e);
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      e.printStackTrace(pw);
      controller.getResources().getLogger().info(sw.toString());
    }
  }
  display.dispose();
}
Program: 108904
Project: 108904
Buggy source:
public void showErrorDialog(final String header,final String text){
  MessageDialog.openError(getShell(),header,text);
}

Fixed version (ground truth):
public void showErrorDialog(final String header,final String message,final Throwable t){
  StringWriter sw=new StringWriter();
  PrintWriter pw=new PrintWriter(sw);
  t.printStackTrace(pw);
  final String trace=sw.toString();
  showErrorDialog(header,message,trace);
}
Program: 108905
Project: 108905
Buggy source:
public Splash() throws IOException {
  this.setSize(new Dimension(400,240));
  this.setLocationRelativeTo(null);
  this.setAlwaysOnTop(true);
  this.setAutoRequestFocus(true);
  this.setUndecorated(true);
  this.addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      repaint();
    }
  }
);
}

Fixed version (ground truth):
public Splash() throws IOException {
  this.setSize(new Dimension(400,240));
  this.setLocationRelativeTo(null);
  this.setAlwaysOnTop(true);
  this.setAutoRequestFocus(true);
  this.setUndecorated(true);
  this.setBackground(Color.WHITE);
  this.addComponentListener(new ComponentAdapter(){
    @Override public void componentResized(    ComponentEvent e){
      repaint();
    }
  }
);
}
Program: 108907
Project: 108907
Buggy source:
@Override public void widgetSelected(final SelectionEvent arg0){
  try {
    if (combo.getSelectionIndex() == -1) {
      return;
    }
    selection=combo.getSelectionIndex();
    read(file);
  }
 catch (  final Exception e) {
    controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str") + e.getMessage());
    close();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(final SelectionEvent arg0){
  try {
    if (combo.getSelectionIndex() == -1) {
      return;
    }
    selection=combo.getSelectionIndex();
    read(file);
  }
 catch (  final Exception e) {
    controller.actionShowErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
    close();
  }
}