Program: 133628
Project: 133628
Buggy source:
@Override protected void createMasterPart(IManagedForm managedForm,Composite parent){
  mForm=managedForm;
  FormToolkit toolkit=mForm.getToolkit();
  Section section=toolkit.createSection(parent,Section.TITLE_BAR | Section.DESCRIPTION | Section.EXPANDED);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  section.setLayoutData(gridData);
  section.setLayout(new GridLayout(1,true));
  section.setText("String_Node_Str");
  section.setDescription("String_Node_Str");
  Composite sectionClient=toolkit.createComposite(section);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  layout.marginWidth=2;
  layout.marginHeight=2;
  sectionClient.setLayout(layout);
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  section.setClient(sectionClient);
  final SectionPart sectionPart=new SectionPart(section);
  mForm.addPart(sectionPart);
  TreeViewer treeViewer=new TreeViewer(sectionClient);
  treeViewer.setContentProvider(new MaterialsDatabaseContentProvider());
  treeViewer.setLabelProvider(new MaterialsDatabaseLabelProvider());
  List<Material> materials=materialsDatabase.getMaterials();
  treeViewer.setInput(materialsDatabase.getMaterials());
  treeViewer.getTree().setLayout(new GridLayout(1,true));
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
  data.widthHint=sectionClient.getClientArea().width;
  data.heightHint=sectionClient.getClientArea().height;
  treeViewer.getTree().setLayoutData(data);
  treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      mForm.fireSelectionChanged(sectionPart,event.getSelection());
    }
  }
);
  Composite buttonComposite=new Composite(sectionClient,SWT.NONE);
  buttonComposite.setLayout(new GridLayout(1,false));
  buttonComposite.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,false,true,1,1));
  Button addMaterialButton=new Button(buttonComposite,SWT.PUSH);
  addMaterialButton.setText("String_Node_Str");
  IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  AddMaterialWizard addMaterialWizard=new AddMaterialWizard(window);
  addMaterialWizard.setWindowTitle("String_Node_Str");
  final WizardDialog addMaterialDialog=new WizardDialog(window.getShell(),addMaterialWizard);
  addMaterialButton.addSelectionListener(new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      addMaterialDialog.create();
      addMaterialDialog.open();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
      addMaterialDialog.create();
      addMaterialDialog.open();
    }
  }
);
  Button deleteMaterialButton=new Button(buttonComposite,SWT.PUSH);
  deleteMaterialButton.setText("String_Node_Str");
  String title="String_Node_Str";
  String msg="String_Node_Str";
  String[] labels={"String_Node_Str","String_Node_Str"};
  final MessageDialog deletionDialog=new MessageDialog(parent.getShell(),title,null,msg,MessageDialog.WARNING,labels,0);
  SelectionListener deletionListener=new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      int index=deletionDialog.open();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
      int index=deletionDialog.open();
    }
  }
;
  deleteMaterialButton.addSelectionListener(deletionListener);
  Button restoreMaterialButton=new Button(buttonComposite,SWT.PUSH);
  restoreMaterialButton.setText("String_Node_Str");
  restoreMaterialButton.setToolTipText("String_Node_Str" + "String_Node_Str");
  title="String_Node_Str";
  msg="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  final MessageDialog restoreDialog=new MessageDialog(parent.getShell(),title,null,msg,MessageDialog.WARNING,labels,0);
  SelectionListener restoreListener=new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      int index=restoreDialog.open();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
      int index=restoreDialog.open();
    }
  }
;
  restoreMaterialButton.addSelectionListener(restoreListener);
  return;
}

Fixed version (ground truth):
@Override protected void createMasterPart(IManagedForm managedForm,Composite parent){
  mForm=managedForm;
  FormToolkit toolkit=mForm.getToolkit();
  Section section=toolkit.createSection(parent,Section.TITLE_BAR | Section.DESCRIPTION | Section.EXPANDED);
  GridData gridData=new GridData(GridData.FILL_BOTH);
  section.setLayoutData(gridData);
  section.setLayout(new GridLayout(1,true));
  section.setText("String_Node_Str");
  section.setDescription("String_Node_Str");
  Composite sectionClient=toolkit.createComposite(section);
  GridLayout layout=new GridLayout();
  layout.numColumns=2;
  layout.marginWidth=2;
  layout.marginHeight=2;
  sectionClient.setLayout(layout);
  sectionClient.setLayoutData(new GridData(GridData.FILL_BOTH));
  section.setClient(sectionClient);
  final SectionPart sectionPart=new SectionPart(section);
  mForm.addPart(sectionPart);
  Composite treeComp=new Composite(sectionClient,SWT.NONE);
  treeComp.setLayout(new GridLayout(1,false));
  treeComp.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  final Text filter=new Text(treeComp,SWT.BORDER | SWT.SEARCH);
  filter.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
  treeViewer=new TreeViewer(treeComp);
  treeViewer.setContentProvider(new MaterialsDatabaseContentProvider());
  treeViewer.setLabelProvider(new MaterialsDatabaseLabelProvider());
  materials=materialsDatabase.getMaterials();
  Collections.sort(materials,new Comparator<Material>(){
    public int compare(    Material first,    Material second){
      return (first.getName().compareTo(second.getName()));
    }
  }
);
  List<Material> editableCopy=new ArrayList<Material>();
  for (int i=0; i < materials.size(); i++) {
    editableCopy.add(materials.get(i));
  }
  treeViewer.setInput(editableCopy);
  filter.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent arg0){
      List<Material> listFromTree=(List<Material>)treeViewer.getInput();
      String filterText=filter.getText().toLowerCase();
      int numRemoved=0;
      for (int i=0; i < materials.size(); i++) {
        Material mat=materials.get(i);
        if (mat.getName().toLowerCase().startsWith(filterText)) {
          if (!listFromTree.contains(mat)) {
            listFromTree.add(i - numRemoved,mat);
          }
        }
 else {
          if (listFromTree.contains(mat)) {
            listFromTree.remove(mat);
          }
          numRemoved++;
        }
      }
      treeViewer.refresh();
    }
  }
);
  treeViewer.getTree().setLayout(new GridLayout(1,true));
  GridData data=new GridData(SWT.FILL,SWT.FILL,true,true,1,1);
  data.widthHint=sectionClient.getClientArea().width;
  data.heightHint=sectionClient.getClientArea().height;
  treeViewer.getTree().setLayoutData(data);
  treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      mForm.fireSelectionChanged(sectionPart,event.getSelection());
    }
  }
);
  Composite buttonComposite=new Composite(sectionClient,SWT.NONE);
  buttonComposite.setLayout(new GridLayout(1,false));
  buttonComposite.setLayoutData(new GridData(SWT.RIGHT,SWT.FILL,false,true,1,1));
  Button addMaterialButton=new Button(buttonComposite,SWT.PUSH);
  addMaterialButton.setText("String_Node_Str");
  IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  AddMaterialWizard addMaterialWizard=new AddMaterialWizard(window);
  addMaterialWizard.setWindowTitle("String_Node_Str");
  final WizardDialog addMaterialDialog=new WizardDialog(window.getShell(),addMaterialWizard);
  addMaterialButton.addSelectionListener(new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      addMaterialDialog.create();
      addMaterialDialog.open();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
      addMaterialDialog.create();
      addMaterialDialog.open();
    }
  }
);
  Button deleteMaterialButton=new Button(buttonComposite,SWT.PUSH);
  deleteMaterialButton.setText("String_Node_Str");
  String title="String_Node_Str";
  String msg="String_Node_Str";
  String[] labels={"String_Node_Str","String_Node_Str"};
  final MessageDialog deletionDialog=new MessageDialog(parent.getShell(),title,null,msg,MessageDialog.WARNING,labels,0);
  SelectionListener deletionListener=new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      int index=deletionDialog.open();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
      int index=deletionDialog.open();
    }
  }
;
  deleteMaterialButton.addSelectionListener(deletionListener);
  Button restoreMaterialButton=new Button(buttonComposite,SWT.PUSH);
  restoreMaterialButton.setText("String_Node_Str");
  restoreMaterialButton.setToolTipText("String_Node_Str" + "String_Node_Str");
  title="String_Node_Str";
  msg="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  final MessageDialog restoreDialog=new MessageDialog(parent.getShell(),title,null,msg,MessageDialog.WARNING,labels,0);
  SelectionListener restoreListener=new SelectionListener(){
    @Override public void widgetSelected(    SelectionEvent e){
      int index=restoreDialog.open();
    }
    @Override public void widgetDefaultSelected(    SelectionEvent e){
      int index=restoreDialog.open();
    }
  }
;
  restoreMaterialButton.addSelectionListener(restoreListener);
  return;
}