nus-yam/ex-repair huggingface dataset:
Program: 108653
Project: 108653
Buggy source:
/** 
 * Creates a new instance for the given data type
 * @param dataType
 * @param data
 */
public HierarchyWizardModel(DataType<T> dataType,String[] data){
  this.data=data;
  this.dataType=dataType;
  orderModel=new HierarchyWizardModelOrder<T>(dataType,getOrderData());
  if (dataType instanceof DataTypeWithRatioScale) {
    intervalModel=new HierarchyWizardModelInterval<T>(dataType,data);
  }
  redactionModel=new HierarchyWizardModelRedaction<T>(dataType,data);
  if (equals(dataType,DataType.DATE)) {
    this.type=Type.INTERVAL_BASED;
  }
 else   if (equals(dataType,DataType.DECIMAL)) {
    this.type=Type.INTERVAL_BASED;
  }
 else   if (equals(dataType,DataType.INTEGER)) {
    this.type=Type.INTERVAL_BASED;
  }
 else   if (equals(dataType,DataType.ORDERED_STRING)) {
    this.type=Type.ORDER_BASED;
  }
 else   if (equals(dataType,DataType.STRING)) {
    this.type=Type.REDACTION_BASED;
  }
  if (data != null && dataType instanceof DataTypeWithRatioScale) {
    @SuppressWarnings("String_Node_Str") DataTypeWithRatioScale<T> dataTypeWRS=(DataTypeWithRatioScale<T>)dataType;
    T min=null;
    T max=null;
    for (    String date : data) {
      T value=dataTypeWRS.parse(date);
      if (min == null || dataTypeWRS.compare(value,min) < 0)       min=value;
      if (max == null || dataTypeWRS.compare(value,max) > 0)       max=value;
    }
    this.intervalModel.getLowerRange().label=min;
    this.intervalModel.getLowerRange().repeat=min;
    this.intervalModel.getLowerRange().snap=min;
    this.intervalModel.getUpperRange().label=max;
    this.intervalModel.getUpperRange().repeat=max;
    this.intervalModel.getUpperRange().snap=max;
  }
}

Fixed version (ground truth):
/** 
 * Creates a new instance for the given data type
 * @param dataType
 * @param data
 */
public HierarchyWizardModel(DataType<T> dataType,String[] data){
  this.data=data;
  this.dataType=dataType;
  orderModel=new HierarchyWizardModelOrder<T>(dataType,getOrderData());
  if (dataType instanceof DataTypeWithRatioScale) {
    intervalModel=new HierarchyWizardModelInterval<T>(dataType,data);
  }
  redactionModel=new HierarchyWizardModelRedaction<T>(dataType,data);
  if (equals(dataType,DataType.DATE)) {
    this.type=Type.INTERVAL_BASED;
  }
 else   if (equals(dataType,DataType.DECIMAL)) {
    this.type=Type.INTERVAL_BASED;
  }
 else   if (equals(dataType,DataType.INTEGER)) {
    this.type=Type.INTERVAL_BASED;
  }
 else   if (equals(dataType,DataType.ORDERED_STRING)) {
    this.type=Type.ORDER_BASED;
  }
 else   if (equals(dataType,DataType.STRING)) {
    this.type=Type.REDACTION_BASED;
  }
}
Program: 108654
Project: 108654
Buggy source:
/** 
 * Update all UI components, apart from the sender
 * @param sender
 */
public void update(HierarchyWizardView sender){
  renderer.update();
  for (  HierarchyWizardView c : components) {
    if (c != sender) {
      c.update();
    }
  }
}

Fixed version (ground truth):
/** 
 * Update all UI components, apart from the sender
 * @param sender
 */
public void update(HierarchyWizardView sender){
  super.update();
  renderer.update();
  for (  HierarchyWizardView c : components) {
    if (c != sender) {
      c.update();
    }
  }
}
Program: 108655
Project: 108655
Buggy source:
@Override public void update(){
  if (model.getError() != null) {
    this.setErrorMessage(model.getError());
    this.setPageComplete(false);
  }
 else {
    this.setErrorMessage(null);
    finalPage.setGroups(model.getGroups());
    finalPage.setHierarchy(model.getHierarchy());
    this.setPageComplete(true);
  }
}

Fixed version (ground truth):
@Override public void update(){
  if (model.getError() != null) {
    this.setErrorMessage(model.getError());
    finalPage.setGroups(null);
    finalPage.setHierarchy(null);
    this.setPageComplete(false);
  }
 else {
    this.setErrorMessage(null);
    finalPage.setGroups(model.getGroups());
    finalPage.setHierarchy(model.getHierarchy());
    this.setPageComplete(true);
  }
}
Program: 108656
Project: 108656
Buggy source:
/** 
 * File->export data
 */
public void actionMenuFileExportData(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getOutput() == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  if (model.getOutputNode().isAnonymous() != Anonymity.ANONYMOUS) {
    if (!main.showQuestionDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"))) {
      return;
    }
  }
  String file=main.showSaveFileDialog(main.getShell(),"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(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),worker.getError());
    return;
  }
}

Fixed version (ground truth):
/** 
 * File->export data
 */
public void actionMenuFileExportData(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getOutput() == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  if (model.getOutputNode().isAnonymous() != Anonymity.ANONYMOUS) {
    if (!main.showQuestionDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"))) {
      return;
    }
  }
  String file=main.showSaveFileDialog(main.getShell(),"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(main.getShell(),Resources.getMessage("String_Node_Str"),worker.getError());
    return;
  }
}
Program: 108657
Project: 108657
Buggy source:
/** 
 * Shows an error dialog
 * @param header
 * @param text
 */
public void actionShowErrorDialog(final Shell shell,final String header,final String text,final Throwable t){
  main.showErrorDialog(shell,header,text,t);
}

Fixed version (ground truth):
/** 
 * Shows an error dialog
 * @param header
 * @param text
 */
public void actionShowErrorDialog(final Shell shell,final String text,final Throwable t){
  main.showErrorDialog(shell,text,t);
}
Program: 108658
Project: 108658
Buggy source:
/** 
 * Internal method for importing hierarchies
 * @param path
 * @param separator
 * @return
 */
private Hierarchy actionImportHierarchy(final String path,final char separator){
  try {
    return Hierarchy.create(path,separator);
  }
 catch (  Throwable error) {
    if (error instanceof RuntimeException) {
      if (error.getCause() != null) {
        error=error.getCause();
      }
    }
    if ((error instanceof IllegalArgumentException) || (error instanceof IOException)) {
      main.showInfoDialog(main.getShell(),"String_Node_Str",error.getMessage());
    }
 else {
      main.showErrorDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),error);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Internal method for importing hierarchies
 * @param path
 * @param separator
 * @return
 */
private Hierarchy actionImportHierarchy(final String path,final char separator){
  try {
    return Hierarchy.create(path,separator);
  }
 catch (  Throwable error) {
    if (error instanceof RuntimeException) {
      if (error.getCause() != null) {
        error=error.getCause();
      }
    }
    if ((error instanceof IllegalArgumentException) || (error instanceof IOException)) {
      main.showInfoDialog(main.getShell(),"String_Node_Str",error.getMessage());
    }
 else {
      main.showErrorDialog(main.getShell(),Resources.getMessage("String_Node_Str"),error);
    }
  }
  return null;
}
Program: 108659
Project: 108659
Buggy source:
/** 
 * Creates a research subset from a file
 */
public void actionSubsetFile(){
  ImportDataWizard wizard=new ImportDataWizard(this,model);
  new WizardDialog(main.getShell(),wizard).open();
  DataSourceConfiguration config=wizard.getResultingConfiguration();
  if (config == null) {
    return;
  }
  final WorkerImport worker=new WorkerImport(config);
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    if (worker.getError() instanceof IllegalArgumentException) {
      main.showInfoDialog(main.getShell(),"String_Node_Str",worker.getError().getMessage());
    }
 else {
      main.showErrorDialog(main.getShell(),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.showInfoDialog(main.getShell(),"String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Creates a research subset from a file
 */
public void actionSubsetFile(){
  ImportDataWizard wizard=new ImportDataWizard(this,model);
  new WizardDialog(main.getShell(),wizard).open();
  DataSourceConfiguration config=wizard.getResultingConfiguration();
  if (config == null) {
    return;
  }
  final WorkerImport worker=new WorkerImport(config);
  main.showProgressDialog(Resources.getMessage("String_Node_Str"),worker);
  if (worker.getError() != null) {
    if (worker.getError() instanceof IllegalArgumentException) {
      main.showInfoDialog(main.getShell(),"String_Node_Str",worker.getError().getMessage());
    }
 else {
      main.showErrorDialog(main.getShell(),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.showInfoDialog(main.getShell(),"String_Node_Str",e.getMessage());
  }
}
Program: 108660
Project: 108660
Buggy source:
/** 
 * Internal method for saving a project
 */
private void actionSaveProject(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),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(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),worker.getError());
    return;
  }
}

Fixed version (ground truth):
/** 
 * Internal method for saving a project
 */
private void actionSaveProject(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),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.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),worker.getError().getMessage());
    return;
  }
}
Program: 108661
Project: 108661
Buggy source:
/** 
 * Starts the "edit settings" dialog
 */
public void actionMenuEditSettings(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  try {
    final DialogProperties dialog=new DialogProperties(main.getShell(),model);
    dialog.create();
    dialog.open();
    ((IView)main).update(new ModelEvent(this,ModelPart.MODEL,model));
  }
 catch (  final Exception e) {
    main.showErrorDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    getResources().getLogger().info(e);
  }
}

Fixed version (ground truth):
/** 
 * Starts the "edit settings" dialog
 */
public void actionMenuEditSettings(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  try {
    final DialogProperties dialog=new DialogProperties(main.getShell(),model);
    dialog.create();
    dialog.open();
    ((IView)main).update(new ModelEvent(this,ModelPart.MODEL,model));
  }
 catch (  final Exception e) {
    main.showErrorDialog(main.getShell(),Resources.getMessage("String_Node_Str"),e);
    getResources().getLogger().info(e);
  }
}
Program: 108665
Project: 108665
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(main.getShell(),"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()));
    if (model.getMaximalSizeForComplexOperations() == 0 || model.getInputConfig().getInput().getHandle().getNumRows() <= model.getMaximalSizeForComplexOperations()) {
      this.model.getViewConfig().setMode(Mode.GROUPED);
      this.updateViewConfig(true);
    }
 else {
      this.model.getViewConfig().setMode(Mode.UNSORTED);
    }
    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(main.getShell(),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()));
    if (model.getMaximalSizeForComplexOperations() == 0 || model.getInputConfig().getInput().getHandle().getNumRows() <= model.getMaximalSizeForComplexOperations()) {
      this.model.getViewConfig().setMode(Mode.GROUPED);
      this.updateViewConfig(true);
    }
 else {
      this.model.getViewConfig().setMode(Mode.UNSORTED);
    }
    this.update(new ModelEvent(this,ModelPart.VIEW_CONFIG,model.getOutput()));
  }
}
Program: 108666
Project: 108666
Buggy source:
/** 
 * Pull settings into the criterion
 * @param criterion
 */
public void actionCriterionPull(ModelCriterion criterion){
  List<ModelExplicitCriterion> others=new ArrayList<ModelExplicitCriterion>();
  if (criterion instanceof ModelLDiversityCriterion) {
    for (    ModelLDiversityCriterion other : model.getLDiversityModel().values()) {
      if (!other.equals(criterion) && other.isActive() && other.isEnabled()) {
        others.add((ModelExplicitCriterion)other);
      }
    }
  }
 else   if (criterion instanceof ModelTClosenessCriterion) {
    for (    ModelTClosenessCriterion other : model.getTClosenessModel().values()) {
      if (!other.equals(criterion) && other.isActive() && other.isEnabled()) {
        others.add((ModelExplicitCriterion)other);
      }
    }
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  if (others.isEmpty()) {
    main.showErrorDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  ModelExplicitCriterion element=main.showSelectCriterionDialog(others);
  if (element == null) {
    return;
  }
 else {
    ((ModelExplicitCriterion)criterion).pull(element);
    update(new ModelEvent(this,ModelPart.CRITERION_DEFINITION,criterion));
  }
}

Fixed version (ground truth):
/** 
 * Pull settings into the criterion
 * @param criterion
 */
public void actionCriterionPull(ModelCriterion criterion){
  List<ModelExplicitCriterion> others=new ArrayList<ModelExplicitCriterion>();
  if (criterion instanceof ModelLDiversityCriterion) {
    for (    ModelLDiversityCriterion other : model.getLDiversityModel().values()) {
      if (!other.equals(criterion) && other.isActive() && other.isEnabled()) {
        others.add((ModelExplicitCriterion)other);
      }
    }
  }
 else   if (criterion instanceof ModelTClosenessCriterion) {
    for (    ModelTClosenessCriterion other : model.getTClosenessModel().values()) {
      if (!other.equals(criterion) && other.isActive() && other.isEnabled()) {
        others.add((ModelExplicitCriterion)other);
      }
    }
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
  if (others.isEmpty()) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  ModelExplicitCriterion element=main.showSelectCriterionDialog(others);
  if (element == null) {
    return;
  }
 else {
    ((ModelExplicitCriterion)criterion).pull(element);
    update(new ModelEvent(this,ModelPart.CRITERION_DEFINITION,criterion));
  }
}
Program: 108667
Project: 108667
Buggy source:
/** 
 * File->Export hierarchy
 */
public void actionMenuFileExportHierarchy(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (!(model.isQuasiIdentifierSelected() || model.isSensitiveAttributeSelected())) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  String file=main.showSaveFileDialog(main.getShell(),"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(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    }
 else {
      out.write(h.getHierarchy());
    }
  }
 catch (  final Exception e) {
    main.showErrorDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),e);
  }
}

Fixed version (ground truth):
/** 
 * File->Export hierarchy
 */
public void actionMenuFileExportHierarchy(){
  if (model == null) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (!(model.isQuasiIdentifierSelected() || model.isSensitiveAttributeSelected())) {
    main.showInfoDialog(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  String file=main.showSaveFileDialog(main.getShell(),"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(main.getShell(),Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    }
 else {
      out.write(h.getHierarchy());
    }
  }
 catch (  final Exception e) {
    main.showErrorDialog(main.getShell(),Resources.getMessage("String_Node_Str"),e);
  }
}
Program: 108669
Project: 108669
Buggy source:
/** 
 * Constructor for displaying two messages
 * @param parentShell
 * @param controller
 * @param title
 * @param message
 * @param error
 */
public DialogError(final Shell parentShell,final Controller controller,final String message,String error){
  super(parentShell);
  this.message=message;
  this.error=error;
  this.image=controller.getResources().getImage("String_Node_Str");
  setTitle("String_Node_Str");
  setMessage(message,IMessageProvider.ERROR);
}

Fixed version (ground truth):
/** 
 * Constructor for displaying two messages
 * @param parentShell
 * @param controller
 * @param title
 * @param message
 * @param error
 */
public DialogError(final Shell parentShell,final Controller controller,final String message,String error){
  super(parentShell);
  this.message=message;
  this.error=error;
  this.image=controller.getResources().getImage("String_Node_Str");
}
Program: 108670
Project: 108670
Buggy source:
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  if (message != null) {
    final Label label=new Label(parent,SWT.NONE);
    label.setText(message.replaceAll("String_Node_Str","String_Node_Str"));
    label.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  }
  if (error != null) {
    final Text text=new Text(parent,SWT.NONE | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL| SWT.BORDER);
    text.setText(error);
    final GridData d=SWTUtil.createFillGridData();
    d.heightHint=100;
    text.setLayoutData(d);
  }
  return parent;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  final Text text=new Text(parent,SWT.NONE | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL| SWT.BORDER);
  text.setText(error);
  final GridData d=SWTUtil.createFillGridData();
  d.heightHint=100;
  text.setLayoutData(d);
  return parent;
}
Program: 108671
Project: 108671
Buggy source:
@Override protected Control createContents(Composite parent){
  Control contents=super.createContents(parent);
  if (image != null)   setTitleImage(image);
  return contents;
}

Fixed version (ground truth):
@Override protected Control createContents(Composite parent){
  Control contents=super.createContents(parent);
  setTitle("String_Node_Str");
  setMessage(message.replaceAll("String_Node_Str","String_Node_Str"),IMessageProvider.ERROR);
  if (image != null)   setTitleImage(image);
  return contents;
}
Program: 108672
Project: 108672
Buggy source:
@Override public void shellClosed(final ShellEvent event){
  event.doit=false;
}

Fixed version (ground truth):
@Override public void shellClosed(final ShellEvent event){
  setReturnCode(Window.CANCEL);
}
Program: 108673
Project: 108673
Buggy source:
@Override protected ShellListener getShellListener(){
  return new ShellAdapter(){
    @Override public void shellClosed(    final ShellEvent event){
      event.doit=false;
    }
  }
;
}

Fixed version (ground truth):
@Override protected ShellListener getShellListener(){
  return new ShellAdapter(){
    @Override public void shellClosed(    final ShellEvent event){
      setReturnCode(Window.CANCEL);
    }
  }
;
}
Program: 108674
Project: 108674
Buggy source:
@Override public void shellClosed(final ShellEvent event){
  event.doit=ok.isEnabled();
}

Fixed version (ground truth):
@Override public void shellClosed(final ShellEvent event){
  setReturnCode(Window.CANCEL);
}
Program: 108675
Project: 108675
Buggy source:
@Override protected ShellListener getShellListener(){
  return new ShellAdapter(){
    @Override public void shellClosed(    final ShellEvent event){
      event.doit=ok.isEnabled();
    }
  }
;
}

Fixed version (ground truth):
@Override protected ShellListener getShellListener(){
  return new ShellAdapter(){
    @Override public void shellClosed(    final ShellEvent event){
      setReturnCode(Window.CANCEL);
    }
  }
;
}
Program: 108679
Project: 108679
Buggy source:
/** 
 * Updates the max generalization level
 * @return
 */
private boolean pushMax(){
  if (max.getSelectionIndex() >= 0 && max.getItemCount() > 1) {
    if (max.getSelectionIndex() < (min.getSelectionIndex() - 1)) {
      max.select(min.getSelectionIndex() - 1);
    }
 else {
      if (model != null) {
        String val=max.getItem(max.getSelectionIndex());
        if (val.equals(ITEM_ALL)) {
          model.getInputConfig().setMaximumGeneralization(attribute,null);
        }
 else {
          model.getInputConfig().setMaximumGeneralization(attribute,Integer.valueOf(val) - 1);
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Updates the max generalization level
 * @return
 */
private boolean pushMax(){
  if (max.getSelectionIndex() >= 0 && max.getItemCount() > 1) {
    if (max.getSelectionIndex() < (min.getSelectionIndex() - 1)) {
      max.select(min.getSelectionIndex() - 1);
    }
    if (model != null) {
      String val=max.getItem(max.getSelectionIndex());
      if (val.equals(ITEM_ALL)) {
        model.getInputConfig().setMaximumGeneralization(attribute,null);
      }
 else {
        model.getInputConfig().setMaximumGeneralization(attribute,Integer.valueOf(val) - 1);
      }
      return true;
    }
  }
  return false;
}
Program: 108680
Project: 108680
Buggy source:
/** 
 * Updates the min generalization level
 * @return
 */
private boolean pushMin(){
  if (min.getSelectionIndex() >= 0 && min.getItemCount() > 1) {
    if (min.getSelectionIndex() > (max.getSelectionIndex() + 1)) {
      min.select(max.getSelectionIndex() + 1);
    }
 else {
      if (model != null) {
        String val=min.getItem(min.getSelectionIndex());
        if (val.equals(ITEM_ALL)) {
          model.getInputConfig().setMinimumGeneralization(attribute,null);
        }
 else {
          model.getInputConfig().setMinimumGeneralization(attribute,Integer.valueOf(val) - 1);
        }
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Updates the min generalization level
 * @return
 */
private boolean pushMin(){
  if (min.getSelectionIndex() >= 0 && min.getItemCount() > 1) {
    if (min.getSelectionIndex() > (max.getSelectionIndex() + 1)) {
      min.select(max.getSelectionIndex() + 1);
    }
    if (model != null) {
      String val=min.getItem(min.getSelectionIndex());
      if (val.equals(ITEM_ALL)) {
        model.getInputConfig().setMinimumGeneralization(attribute,null);
      }
 else {
        model.getInputConfig().setMinimumGeneralization(attribute,Integer.valueOf(val) - 1);
      }
      return true;
    }
  }
  return false;
}
Program: 108682
Project: 108682
Buggy source:
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.HIERARCHY) {
    if (attribute.equals(model.getSelectedAttribute())) {
      setHierarchy((Hierarchy)event.data);
      base.setEnabled(true);
      base.redraw();
    }
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
  }
 else   if (event.part == ModelPart.INPUT) {
    Hierarchy h=model.getInputConfig().getHierarchy(attribute);
    if (h != null) {
      setHierarchy(h);
      base.setEnabled(true);
      base.redraw();
    }
 else {
      reset();
    }
  }
 else   if (event.part == ModelPart.ATTRIBUTE_TYPE) {
    if (event.data.equals(this.attribute)) {
      updateGlobalHierarchy();
    }
  }
}

Fixed version (ground truth):
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.HIERARCHY) {
    if (attribute.equals(model.getSelectedAttribute())) {
      setHierarchy((Hierarchy)event.data);
      base.setEnabled(true);
      base.redraw();
      updateGlobalHierarchy();
    }
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
  }
 else   if (event.part == ModelPart.INPUT) {
    Hierarchy h=model.getInputConfig().getHierarchy(attribute);
    if (h != null) {
      setHierarchy(h);
      base.setEnabled(true);
      base.redraw();
      updateGlobalHierarchy();
    }
 else {
      reset();
    }
  }
 else   if (event.part == ModelPart.ATTRIBUTE_TYPE) {
    if (event.data.equals(this.attribute)) {
      updateGlobalHierarchy();
    }
  }
}
Program: 108683
Project: 108683
Buggy source:
/** 
 * Updates the global hierarchy definition
 */
private void updateGlobalHierarchy(){
  updateMinAndMax();
  if (model == null || model.getInputConfig() == null) {
    return;
  }
  final Hierarchy h=Hierarchy.create(hierarchy);
  model.getInputConfig().setHierarchy(attribute,h);
}

Fixed version (ground truth):
/** 
 * Updates the global hierarchy definition
 */
private void updateGlobalHierarchy(){
  updateMinAndMax();
  if (model == null || model.getInputConfig() == null) {
    return;
  }
  final Hierarchy h=Hierarchy.create(hierarchy);
  model.getInputConfig().setHierarchy(attribute,h);
  updateMin();
  updateMax();
}
Program: 108684
Project: 108684
Buggy source:
/** 
 * Starts the wizard
 */
public void actionMenuEditCreateHierarchy(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getInputConfig().getInput() == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  final String attr=model.getSelectedAttribute();
  final int index=model.getInputConfig().getInput().getHandle().getColumnIndexOf(attr);
  final WizardHierarchy i=new WizardHierarchy(this,attr,model.getInputConfig().getInput().getDefinition().getDataType(attr),model.getSuppressionString(),model.getInputConfig().getInput().getHandle().getStatistics().getDistinctValues(index));
  if (i.open(main.getShell())) {
    Hierarchy hierarchy=i.getModel().getHierarchy();
    if (hierarchy != null) {
      model.getInputConfig().setHierarchy(attr,hierarchy);
      update(new ModelEvent(this,ModelPart.HIERARCHY,hierarchy));
    }
  }
}

Fixed version (ground truth):
/** 
 * Starts the wizard
 */
public void actionMenuEditCreateHierarchy(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getInputConfig().getInput() == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
  final String attr=model.getSelectedAttribute();
  final int index=model.getInputConfig().getInput().getHandle().getColumnIndexOf(attr);
  final WizardHierarchy i=new WizardHierarchy(this,attr,model.getInputConfig().getInput().getDefinition().getDataType(attr),model.getSuppressionString(),model.getInputConfig().getInput().getHandle().getStatistics().getDistinctValues(index));
  if (i.open(main.getShell())) {
    Hierarchy hierarchy=i.getModel().getHierarchy();
    if (hierarchy != null) {
      model.getInputConfig().setMaximumGeneralization(attr,null);
      model.getInputConfig().setMinimumGeneralization(attr,null);
      model.getInputConfig().setHierarchy(attr,hierarchy);
      update(new ModelEvent(this,ModelPart.HIERARCHY,hierarchy));
    }
  }
}
Program: 108687
Project: 108687
Buggy source:
@Override public ModelConfiguration clone(){
  final ModelConfiguration c=new ModelConfiguration();
  c.removeOutliers=removeOutliers;
  c.input=input;
  c.config=config.clone();
  c.hierarchies=new HashMap<String,Hierarchy>(hierarchies);
  c.researchSubset=this.getCriterion(DPresence.class).getSubset().getSet();
  return c;
}

Fixed version (ground truth):
@Override public ModelConfiguration clone(){
  final ModelConfiguration c=new ModelConfiguration();
  c.removeOutliers=removeOutliers;
  c.input=input;
  c.min=new HashMap<String,Integer>(min);
  c.max=new HashMap<String,Integer>(max);
  c.config=config.clone();
  c.hierarchies=new HashMap<String,Hierarchy>(hierarchies);
  c.researchSubset=this.getCriterion(DPresence.class).getSubset().getSet();
  return c;
}
Program: 108692
Project: 108692
Buggy source:
/** 
 * @param output the output to set
 */
public void setOutput(final DataHandle output,final ARXNode node){
  this.output=output;
  this.outputNode=node;
  if (node != null) {
    outputNodeAsString=Arrays.toString(node.getTransformation());
  }
  setModified();
}

Fixed version (ground truth):
/** 
 * @param output the output to set
 */
public void setOutput(final DataHandle output,final ARXNode node){
  this.output=output;
  this.outputNode=node;
  if (node != null) {
    outputNodeAsString=Arrays.toString(node.getTransformation());
  }
 else {
    outputNodeAsString=null;
  }
  setModified();
}
Program: 108693
Project: 108693
Buggy source:
/** 
 * Creates the design of this page This adds all the controls to the page along with their listeners. It basically waits for any radio button to be pressed, which will mark the page as completed and lets the user proceed to the next page.
 */
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  setControl(container);
  container.setLayout(new GridLayout(1,false));
  btnCsv=new Button(container,SWT.RADIO);
  btnCsv.setText("String_Node_Str");
  btnCsv.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      wizardImport.getData().setSourceType(SourceType.CSV);
      setPageComplete(true);
    }
  }
);
  btnExcel=new Button(container,SWT.RADIO);
  btnExcel.setText("String_Node_Str");
  btnExcel.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      wizardImport.getData().setSourceType(SourceType.EXCEL);
      setPageComplete(true);
    }
  }
);
  btnJdbc=new Button(container,SWT.RADIO);
  btnJdbc.setEnabled(false);
  btnJdbc.setText("String_Node_Str");
  btnJdbc.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      wizardImport.getData().setSourceType(SourceType.JDBC);
      setPageComplete(true);
    }
  }
);
  setPageComplete(false);
}

Fixed version (ground truth):
/** 
 * Creates the design of this page This adds all the controls to the page along with their listeners. It basically waits for any radio button to be pressed, which will mark the page as completed and lets the user proceed to the next page.
 */
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  setControl(container);
  container.setLayout(new GridLayout(1,false));
  btnCsv=new Button(container,SWT.RADIO);
  btnCsv.setText("String_Node_Str");
  btnCsv.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      wizardImport.getData().setSourceType(SourceType.CSV);
      setPageComplete(true);
    }
  }
);
  btnExcel=new Button(container,SWT.RADIO);
  btnExcel.setText("String_Node_Str");
  btnExcel.setEnabled(false);
  btnExcel.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      wizardImport.getData().setSourceType(SourceType.EXCEL);
      setPageComplete(true);
    }
  }
);
  btnJdbc=new Button(container,SWT.RADIO);
  btnJdbc.setEnabled(false);
  btnJdbc.setText("String_Node_Str");
  btnJdbc.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      wizardImport.getData().setSourceType(SourceType.JDBC);
      setPageComplete(true);
    }
  }
);
  setPageComplete(false);
}
Program: 108695
Project: 108695
Buggy source:
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.HIERARCHY) {
    if (attribute.equals(model.getSelectedAttribute())) {
      setHierarchy((Hierarchy)event.data);
      base.setEnabled(true);
      base.redraw();
    }
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
  }
 else   if (event.part == ModelPart.INPUT) {
    final DataDefinition d=model.getInputConfig().getInput().getDefinition();
    final AttributeType type=d.getAttributeType(attribute);
    if (type instanceof Hierarchy) {
      setHierarchy((Hierarchy)type);
      base.setEnabled(true);
      base.redraw();
    }
 else     if ((type == AttributeType.SENSITIVE_ATTRIBUTE) && (model.getInputConfig().getHierarchy(attribute) != null)) {
      setHierarchy(model.getInputConfig().getHierarchy(attribute));
      base.setEnabled(true);
      base.redraw();
    }
 else {
      reset();
    }
  }
 else   if (event.part == ModelPart.ATTRIBUTE_TYPE) {
    if (event.data.equals(this.attribute)) {
      updateGlobalHierarchy();
    }
  }
}

Fixed version (ground truth):
@Override public void update(final ModelEvent event){
  if (event.part == ModelPart.HIERARCHY) {
    if (attribute.equals(model.getSelectedAttribute())) {
      setHierarchy((Hierarchy)event.data);
      base.setEnabled(true);
      base.redraw();
    }
  }
 else   if (event.part == ModelPart.MODEL) {
    model=(Model)event.data;
  }
 else   if (event.part == ModelPart.INPUT) {
    Hierarchy h=model.getInputConfig().getHierarchy(attribute);
    if (h != null) {
      setHierarchy(h);
      base.setEnabled(true);
      base.redraw();
    }
 else {
      reset();
    }
  }
 else   if (event.part == ModelPart.ATTRIBUTE_TYPE) {
    if (event.data.equals(this.attribute)) {
      updateGlobalHierarchy();
    }
  }
}
Program: 108697
Project: 108697
Buggy source:
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  if (message != null) {
    final Label label=new Label(parent,SWT.NONE);
    label.setText(message);
    final GridData d=SWTUtil.createFillHorizontallyGridData();
    d.heightHint=20;
    label.setLayoutData(d);
  }
  if (error != null) {
    final Text text=new Text(parent,SWT.NONE | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL| SWT.BORDER);
    text.setText(error);
    final GridData d=SWTUtil.createFillGridData();
    d.heightHint=100;
    text.setLayoutData(d);
  }
  return parent;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(new GridLayout());
  if (message != null) {
    final Label label=new Label(parent,SWT.NONE);
    label.setText(message.replaceAll("String_Node_Str","String_Node_Str"));
    label.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  }
  if (error != null) {
    final Text text=new Text(parent,SWT.NONE | SWT.MULTI | SWT.V_SCROLL| SWT.H_SCROLL| SWT.BORDER);
    text.setText(error);
    final GridData d=SWTUtil.createFillGridData();
    d.heightHint=100;
    text.setLayoutData(d);
  }
  return parent;
}
Program: 108698
Project: 108698
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);
  }
  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 (  Throwable error) {
    if (error instanceof RuntimeException) {
      if (error.getCause() != null) {
        error=error.getCause();
      }
    }
    if ((error instanceof IllegalArgumentException) || (error instanceof IOException)) {
      main.showInfoDialog("String_Node_Str",error.getMessage());
    }
 else {
      main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),error);
    }
  }
  return null;
}
Program: 108700
Project: 108700
Buggy source:
/** 
 * File->Import hierarchy
 */
public void actionMenuFileImportHierarchy(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getInputConfig().getInput() == 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;
  }
  final String path=actionShowOpenFileDialog("String_Node_Str");
  if (path != null) {
    final DialogSeparator dialog=new DialogSeparator(main.getShell(),this,path,false);
    dialog.create();
    if (dialog.open() == Window.CANCEL) {
      return;
    }
 else {
      final char separator=dialog.getSeparator();
      final AttributeType h=actionImportHierarchy(path,separator);
      update(new ModelEvent(this,ModelPart.HIERARCHY,h));
    }
  }
}

Fixed version (ground truth):
/** 
 * File->Import hierarchy
 */
public void actionMenuFileImportHierarchy(){
  if (model == null) {
    main.showInfoDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"));
    return;
  }
 else   if (model.getInputConfig().getInput() == 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;
  }
  final String path=actionShowOpenFileDialog("String_Node_Str");
  if (path != null) {
    DialogSeparator dialog=null;
    try {
      dialog=new DialogSeparator(main.getShell(),this,path,false);
      dialog.create();
      if (dialog.open() == Window.CANCEL) {
        return;
      }
    }
 catch (    Throwable error) {
      if (error instanceof RuntimeException) {
        if (error.getCause() != null) {
          error=error.getCause();
        }
      }
      if ((error instanceof IllegalArgumentException) || (error instanceof IOException)) {
        main.showInfoDialog("String_Node_Str",error.getMessage());
      }
 else {
        main.showErrorDialog(Resources.getMessage("String_Node_Str"),Resources.getMessage("String_Node_Str"),error);
      }
      return;
    }
    final char separator=dialog.getSeparator();
    final AttributeType h=actionImportHierarchy(path,separator);
    if (h != null)     update(new ModelEvent(this,ModelPart.HIERARCHY,h));
  }
}
Program: 108701
Project: 108701
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);
    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) {
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
 else {
      throw new RuntimeException(e);
    }
  }
}
Program: 108702
Project: 108702
Buggy source:
public DialogSeparator(final Shell parent,final Controller controller,final String file,boolean data){
  super(parent);
  this.controller=controller;
  this.file=file;
  this.data=data;
}

Fixed version (ground truth):
public DialogSeparator(final Shell parent,final Controller controller,final String file,boolean data){
  super(parent);
  this.file=file;
  this.data=data;
}
Program: 108703
Project: 108703
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();
    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;
}

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) {
    if (e instanceof RuntimeException) {
      throw (RuntimeException)e;
    }
 else {
      throw new RuntimeException(e);
    }
  }
  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) {
        if (e instanceof RuntimeException) {
          throw (RuntimeException)e;
        }
 else {
          throw new RuntimeException(e);
        }
      }
    }
  }
);
  return parent;
}