Program: 133689
Project: 133689
Buggy source:
/** 
 * This operation overrides the ViewPart.createPartControl method to create and draw the TreeViewer before registering it as a selection provider.
 * @param parent The Composite used to create the TreeViewer.
 */
@Override public void createPartControl(Composite parent){
  tabFolder=new TabFolder(parent,SWT.NONE);
  TabItem textTab=new TabItem(tabFolder,SWT.NONE,0);
  textTab.setText("String_Node_Str");
  TabItem imageTab=new TabItem(tabFolder,SWT.NONE,1);
  imageTab.setText("String_Node_Str");
  TabItem plotTab=new TabItem(tabFolder,SWT.NONE,2);
  plotTab.setText("String_Node_Str");
  createActions();
  resourceTreeViewer=new TreeViewer(tabFolder);
  initializeTreeViewer(resourceTreeViewer);
  textTab.setControl(resourceTreeViewer.getControl());
  imageTab.setControl(resourceTreeViewer.getControl());
  getSite().setSelectionProvider(resourceTreeViewer);
  tabFolder.addListener(SWT.Selection,new Listener(){
    @Override public void handleEvent(    Event event){
      if (playAction.isInPlayState()) {
        playAction.stop();
      }
      setTreeContent(tabFolder.indexOf((TabItem)event.item));
    }
  }
);
  Table listTable=new Table(tabFolder,SWT.FLAT);
  DefaultEventTableViewer<VizResource> listTableViewer=new DefaultEventTableViewer<VizResource>(plotList,listTable,plotList);
  plotTab.setControl(listTable);
  IPartService partService=getSite().getWorkbenchWindow().getPartService();
  IWorkbenchPartReference partRef=partService.getActivePartReference();
  if (ICEFormEditor.ID.equals(partRef.getId())) {
    ICEFormEditor activeEditor=(ICEFormEditor)partRef.getPart(false);
    if (activeEditor != editor) {
      setActiveEditor(activeEditor);
    }
  }
  partService.addPartListener(this);
  return;
}

Fixed version (ground truth):
/** 
 * This operation overrides the ViewPart.createPartControl method to create and draw the TreeViewer before registering it as a selection provider.
 * @param parent The Composite used to create the TreeViewer.
 */
@Override public void createPartControl(Composite parent){
  tabFolder=new TabFolder(parent,SWT.NONE);
  TabItem textTab=new TabItem(tabFolder,SWT.NONE,0);
  textTab.setText("String_Node_Str");
  TabItem imageTab=new TabItem(tabFolder,SWT.NONE,1);
  imageTab.setText("String_Node_Str");
  TabItem plotTab=new TabItem(tabFolder,SWT.NONE,2);
  plotTab.setText("String_Node_Str");
  createActions();
  resourceTreeViewer=new TreeViewer(tabFolder);
  initializeTreeViewer(resourceTreeViewer);
  textTab.setControl(resourceTreeViewer.getControl());
  imageTab.setControl(resourceTreeViewer.getControl());
  getSite().setSelectionProvider(resourceTreeViewer);
  tabFolder.addListener(SWT.Selection,new Listener(){
    @Override public void handleEvent(    Event event){
      if (playAction.isInPlayState()) {
        playAction.stop();
      }
      setTreeContent(tabFolder.indexOf((TabItem)event.item));
    }
  }
);
  Table listTable=new Table(tabFolder,SWT.FLAT);
  DefaultEventTableViewer<VizResource> listTableViewer=new DefaultEventTableViewer<VizResource>(plotList,listTable,plotList);
  plotTab.setControl(listTable);
  IPartService partService=getSite().getWorkbenchWindow().getPartService();
  IWorkbenchPartReference partRef=partService.getActivePartReference();
  if (partRef != null && ICEFormEditor.ID.equals(partRef.getId())) {
    ICEFormEditor activeEditor=(ICEFormEditor)partRef.getPart(false);
    if (activeEditor != editor) {
      setActiveEditor(activeEditor);
    }
  }
  partService.addPartListener(this);
  return;
}