Program: 119437
Project: 119437
Buggy source:
@Override public void createPartControl(Composite parent){
  this.parent=parent;
  tabFactory.initComposite(parent,false);
  tabFactory.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      TalendPropertyTabDescriptor descriptor=(TalendPropertyTabDescriptor)selection.getFirstElement();
      if (descriptor == null) {
        return;
      }
      if (currentSelectedTab != null) {
        if ((!currentSelectedTab.getData().equals(descriptor.getData()) || currentSelectedTab.getData() != descriptor.getData() || currentSelectedTab.getCategory() != descriptor.getCategory())) {
          for (          Control curControl : tabFactory.getTabComposite().getChildren()) {
            curControl.dispose();
          }
        }
      }
      if (element == null || !element.equals(descriptor.getData()) || currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
        Object data=descriptor.getData();
        if (data instanceof Element) {
          element=(Element)data;
          currentSelectedTab=descriptor;
          IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),element,descriptor.getCategory());
        }
 else         if (data instanceof IRepositoryViewObject) {
          IRepositoryViewObject viewObject=(IRepositoryViewObject)data;
          boolean isOpen=RepositoryManager.isOpenedItemInEditor(viewObject);
          if (isOpen) {
            final IEditorPart activeEditor=getSite().getPage().getActiveEditor();
            if (activeEditor != null && activeEditor instanceof AbstractMultiPageTalendEditor) {
              AbstractTalendEditor talendEditor=((AbstractMultiPageTalendEditor)activeEditor).getTalendEditor();
              IProcess process=talendEditor.getProcess();
              if (process != null && process instanceof Element && process.getId().equals(viewObject.getId())) {
                data=process;
              }
            }
          }
          currentSelectedTab=descriptor;
          IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),data,descriptor.getCategory());
        }
 else         if (data instanceof IEditorPart) {
          currentSelectedTab=descriptor;
          IRepositoryViewObject repObj=retrieveBusiness((IEditorPart)data);
          if (repObj != null) {
            IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),repObj,descriptor.getCategory());
          }
        }
 else {
          currentSelectedTab=descriptor;
          IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),null,descriptor.getCategory());
        }
        selectedPrimary=false;
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  this.parent=parent;
  tabFactory.initComposite(parent,false);
  tabFactory.addSelectionChangedListener(new ISelectionChangedListener(){
    @Override public void selectionChanged(    SelectionChangedEvent event){
      IStructuredSelection selection=(IStructuredSelection)event.getSelection();
      TalendPropertyTabDescriptor descriptor=(TalendPropertyTabDescriptor)selection.getFirstElement();
      if (descriptor == null) {
        return;
      }
      if (currentSelectedTab != null) {
        if ((!currentSelectedTab.getData().equals(descriptor.getData()) || currentSelectedTab.getData() != descriptor.getData() || currentSelectedTab.getCategory() != descriptor.getCategory())) {
          for (          Control curControl : tabFactory.getTabComposite().getChildren()) {
            curControl.dispose();
          }
        }
      }
      if (element == null || !element.equals(descriptor.getData()) || currentSelectedTab == null || currentSelectedTab.getCategory() != descriptor.getCategory() || selectedPrimary) {
        Object data=descriptor.getData();
        if (data instanceof Element) {
          element=(Element)data;
          currentSelectedTab=descriptor;
          IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),element,descriptor.getCategory());
        }
 else         if (data instanceof IRepositoryViewObject) {
          IRepositoryViewObject viewObject=(IRepositoryViewObject)data;
          IProcess process=getProcess(viewObject);
          if (process != null && process instanceof Element && process.getId().equals(viewObject.getId())) {
            data=process;
          }
          currentSelectedTab=descriptor;
          IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),data,descriptor.getCategory());
        }
 else         if (data instanceof IEditorPart) {
          currentSelectedTab=descriptor;
          IRepositoryViewObject repObj=retrieveBusiness((IEditorPart)data);
          if (repObj != null) {
            IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),repObj,descriptor.getCategory());
          }
        }
 else {
          currentSelectedTab=descriptor;
          IDynamicProperty propertyComposite=createTabComposite(tabFactory.getTabComposite(),null,descriptor.getCategory());
        }
        selectedPrimary=false;
      }
    }
  }
);
}