Program: 119464
Project: 119464
Buggy source:
/** 
 * DOC ggu Comment method "setElement".
 * @param obj
 */
private void setElement(Object obj,final String title,Image image){
  EComponentCategory[] categories=null;
  if (obj != null && obj instanceof Process) {
    process=(Process)obj;
    if (currentSelectedTab != null && currentSelectedTab.getData().equals(process) && !cleaned) {
      return;
    }
    categories=getCategories(process);
  }
 else   if (obj != null && obj instanceof IRepositoryViewObject) {
    categories=getCategories(obj);
    IRepositoryViewObject viewObject=(IRepositoryViewObject)obj;
    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())) {
          categories=getCategories(process);
          refresh();
        }
      }
    }
  }
 else   if (obj instanceof IEditorPart) {
    if (CorePlugin.getDefault().getDiagramModelService().isBusinessDiagramEditor((IEditorPart)obj)) {
      categories=getCategories(obj);
    }
  }
 else {
    BusinessType type=CorePlugin.getDefault().getDiagramModelService().getBusinessModelType(obj);
    if (BusinessType.NOTE.equals(type) || BusinessType.SHAP.equals(type) || BusinessType.CONNECTION.equals(type)) {
      categories=getCategories(obj);
    }
 else {
      cleanDisplay();
      return;
    }
  }
  final List<TalendPropertyTabDescriptor> descriptors=new ArrayList<TalendPropertyTabDescriptor>();
  for (  EComponentCategory category : categories) {
    TalendPropertyTabDescriptor d=new TalendPropertyTabDescriptor(category);
    d.setData(obj);
    descriptors.add(d);
  }
  tabFactory.setInput(descriptors);
  setPartName(title,image);
  cleaned=false;
  tabFactory.setSelection(new IStructuredSelection(){
    @Override public Object getFirstElement(){
      return null;
    }
    @Override public Iterator iterator(){
      return null;
    }
    @Override public int size(){
      return 0;
    }
    @Override public Object[] toArray(){
      return null;
    }
    @Override public List toList(){
      List<TalendPropertyTabDescriptor> d=new ArrayList<TalendPropertyTabDescriptor>();
      if (descriptors.size() > 0) {
        if (currentSelectedTab != null) {
          for (          TalendPropertyTabDescriptor ds : descriptors) {
            if (ds.getCategory() == currentSelectedTab.getCategory()) {
              d.add(ds);
              return d;
            }
          }
        }
        d.add(descriptors.get(0));
      }
      return d;
    }
    @Override public boolean isEmpty(){
      return false;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC ggu Comment method "setElement".
 * @param obj
 */
private void setElement(Object obj,final String title,Image image){
  EComponentCategory[] categories=null;
  if (obj != null && obj instanceof Process) {
    process=(Process)obj;
    if (currentSelectedTab != null && currentSelectedTab.getData().equals(process) && !cleaned) {
      return;
    }
    categories=getCategories(process);
  }
 else   if (obj != null && obj instanceof IRepositoryViewObject) {
    categories=getCategories(obj);
    IRepositoryViewObject viewObject=(IRepositoryViewObject)obj;
    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())) {
          categories=getCategories(process);
        }
      }
    }
  }
 else   if (obj instanceof IEditorPart) {
    if (CorePlugin.getDefault().getDiagramModelService().isBusinessDiagramEditor((IEditorPart)obj)) {
      categories=getCategories(obj);
    }
  }
 else {
    BusinessType type=CorePlugin.getDefault().getDiagramModelService().getBusinessModelType(obj);
    if (BusinessType.NOTE.equals(type) || BusinessType.SHAP.equals(type) || BusinessType.CONNECTION.equals(type)) {
      categories=getCategories(obj);
    }
 else {
      cleanDisplay();
      return;
    }
  }
  final List<TalendPropertyTabDescriptor> descriptors=new ArrayList<TalendPropertyTabDescriptor>();
  for (  EComponentCategory category : categories) {
    TalendPropertyTabDescriptor d=new TalendPropertyTabDescriptor(category);
    d.setData(obj);
    descriptors.add(d);
  }
  tabFactory.setInput(descriptors);
  setPartName(title,image);
  cleaned=false;
  tabFactory.setSelection(new IStructuredSelection(){
    @Override public Object getFirstElement(){
      return null;
    }
    @Override public Iterator iterator(){
      return null;
    }
    @Override public int size(){
      return 0;
    }
    @Override public Object[] toArray(){
      return null;
    }
    @Override public List toList(){
      List<TalendPropertyTabDescriptor> d=new ArrayList<TalendPropertyTabDescriptor>();
      if (descriptors.size() > 0) {
        if (currentSelectedTab != null) {
          for (          TalendPropertyTabDescriptor ds : descriptors) {
            if (ds.getCategory() == currentSelectedTab.getCategory()) {
              d.add(ds);
              return d;
            }
          }
        }
        d.add(descriptors.get(0));
      }
      return d;
    }
    @Override public boolean isEmpty(){
      return false;
    }
  }
);
}