Program: 108030
Project: 108030
Buggy source:
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(SWTUtil.createGridLayout(1));
  final DynamicTable table=SWTUtil.createTableDynamic(parent,SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL| SWT.FULL_SELECTION);
  table.setHeaderVisible(true);
  final GridData d=SWTUtil.createFillGridData();
  d.heightHint=200;
  table.setLayoutData(d);
  DynamicTableColumn column1=new DynamicTableColumn(table,SWT.NONE);
  column1.setText(Resources.getMessage("String_Node_Str"));
  column1.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column2=new DynamicTableColumn(table,SWT.NONE);
  column2.setText(Resources.getMessage("String_Node_Str"));
  column2.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column3=new DynamicTableColumn(table,SWT.NONE);
  column3.setText(Resources.getMessage("String_Node_Str"));
  column3.setWidth("String_Node_Str","String_Node_Str");
  column1.pack();
  column2.pack();
  column3.pack();
  Image symbolL=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolT=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolK=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolD=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolR=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolDP=controller.getResources().getManagedImage("String_Node_Str");
  for (  ModelCriterion c : elements) {
    TableItem item=new TableItem(table,SWT.NONE);
    if (c instanceof ModelLDiversityCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),((ModelLDiversityCriterion)c).getAttribute()});
      item.setImage(0,symbolL);
    }
 else     if (c instanceof ModelTClosenessCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),((ModelTClosenessCriterion)c).getAttribute()});
      item.setImage(0,symbolT);
    }
 else     if (c instanceof ModelDDisclosurePrivacyCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),((ModelTClosenessCriterion)c).getAttribute()});
      item.setImage(0,symbolD);
    }
 else     if (c instanceof ModelKAnonymityCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolK);
    }
 else     if (c instanceof ModelDPresenceCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolD);
    }
 else     if (c instanceof ModelRiskBasedCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolR);
    }
 else     if (c instanceof ModelDifferentialPrivacyCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolDP);
    }
  }
  table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      if (table.getSelectionIndex() != -1) {
        selection=elements.get(table.getSelectionIndex());
        if (edit)         ok.setEnabled(true);
        update();
      }
 else {
        selection=null;
        if (edit)         ok.setEnabled(false);
        update();
      }
    }
  }
);
  ComponentTitledFolderButton bar=new ComponentTitledFolderButton("String_Node_Str");
  bar.add(Resources.getMessage("String_Node_Str"),controller.getResources().getManagedImage("String_Node_Str"),new Runnable(){
    @Override public void run(){
      if (editor != null) {
        DialogDefaultParameters dialog=new DialogDefaultParameters(DialogCriterionUpdate.this.getShell(),controller,editor.getTypicalParameters());
        dialog.create();
        if (dialog.open() == Window.OK) {
          editor.parseDefault(dialog.getSelection());
        }
      }
    }
  }
);
  ComponentTitledFolder folder=new ComponentTitledFolder(parent,controller,bar,null);
  folder.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  this.root=folder.createItem(Resources.getMessage("String_Node_Str"),null);
  this.root.setLayout(SWTUtil.createGridLayout(1));
  folder.setSelection(0);
  if (selection != null) {
    table.setSelection(elements.indexOf(selection));
  }
 else   if (table.getItemCount() != 0) {
    table.setSelection(0);
    selection=elements.get(0);
  }
  update();
  return parent;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(final Composite parent){
  parent.setLayout(SWTUtil.createGridLayout(1));
  final DynamicTable table=SWTUtil.createTableDynamic(parent,SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL| SWT.FULL_SELECTION);
  table.setHeaderVisible(true);
  final GridData d=SWTUtil.createFillGridData();
  d.heightHint=200;
  table.setLayoutData(d);
  DynamicTableColumn column1=new DynamicTableColumn(table,SWT.NONE);
  column1.setText(Resources.getMessage("String_Node_Str"));
  column1.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column2=new DynamicTableColumn(table,SWT.NONE);
  column2.setText(Resources.getMessage("String_Node_Str"));
  column2.setWidth("String_Node_Str","String_Node_Str");
  DynamicTableColumn column3=new DynamicTableColumn(table,SWT.NONE);
  column3.setText(Resources.getMessage("String_Node_Str"));
  column3.setWidth("String_Node_Str","String_Node_Str");
  column1.pack();
  column2.pack();
  column3.pack();
  Image symbolL=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolT=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolK=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolD=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolR=controller.getResources().getManagedImage("String_Node_Str");
  Image symbolDP=controller.getResources().getManagedImage("String_Node_Str");
  for (  ModelCriterion c : elements) {
    TableItem item=new TableItem(table,SWT.NONE);
    if (c instanceof ModelLDiversityCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),((ModelLDiversityCriterion)c).getAttribute()});
      item.setImage(0,symbolL);
    }
 else     if (c instanceof ModelTClosenessCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),((ModelTClosenessCriterion)c).getAttribute()});
      item.setImage(0,symbolT);
    }
 else     if (c instanceof ModelDDisclosurePrivacyCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),((ModelDDisclosurePrivacyCriterion)c).getAttribute()});
      item.setImage(0,symbolD);
    }
 else     if (c instanceof ModelKAnonymityCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolK);
    }
 else     if (c instanceof ModelDPresenceCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolD);
    }
 else     if (c instanceof ModelRiskBasedCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolR);
    }
 else     if (c instanceof ModelDifferentialPrivacyCriterion) {
      item.setText(new String[]{"String_Node_Str",c.getLabel(),"String_Node_Str"});
      item.setImage(0,symbolDP);
    }
  }
  table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent arg0){
      if (table.getSelectionIndex() != -1) {
        selection=elements.get(table.getSelectionIndex());
        if (edit)         ok.setEnabled(true);
        update();
      }
 else {
        selection=null;
        if (edit)         ok.setEnabled(false);
        update();
      }
    }
  }
);
  ComponentTitledFolderButton bar=new ComponentTitledFolderButton("String_Node_Str");
  bar.add(Resources.getMessage("String_Node_Str"),controller.getResources().getManagedImage("String_Node_Str"),new Runnable(){
    @Override public void run(){
      if (editor != null) {
        DialogDefaultParameters dialog=new DialogDefaultParameters(DialogCriterionUpdate.this.getShell(),controller,editor.getTypicalParameters());
        dialog.create();
        if (dialog.open() == Window.OK) {
          editor.parseDefault(dialog.getSelection());
        }
      }
    }
  }
);
  ComponentTitledFolder folder=new ComponentTitledFolder(parent,controller,bar,null);
  folder.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  this.root=folder.createItem(Resources.getMessage("String_Node_Str"),null);
  this.root.setLayout(SWTUtil.createGridLayout(1));
  folder.setSelection(0);
  if (selection != null) {
    table.setSelection(elements.indexOf(selection));
  }
 else   if (table.getItemCount() != 0) {
    table.setSelection(0);
    selection=elements.get(0);
  }
  update();
  return parent;
}