Program: 125949
Project: 125949
Buggy source:
@Override public void createPartControl(Composite parent){
  service=GitContentServiceProviderManager.getGitContentService();
  if (service != null && service.isGIT())   service.createDropdownCombo(parent);
  super.createPartControl(parent);
  viewer=getCommonViewer();
  if (viewer instanceof ITreeViewerListener) {
    viewer.addTreeListener((ITreeViewerListener)viewer);
  }
  getSite().setSelectionProvider(viewer);
  viewer.addTreeListener(new ITreeViewerListener(){
    @Override public void treeCollapsed(    TreeExpansionEvent event){
      Object element=event.getElement();
      if (element instanceof RepositoryNode) {
        RepositoryNode node=(RepositoryNode)element;
        TreeItem item=getObject(viewer.getTree(),event.getElement());
        if (item != null) {
          if (node.getType().equals(ENodeType.SIMPLE_FOLDER)) {
            item.setImage(ImageProvider.getImage(ECoreImage.FOLDER_CLOSE_ICON));
          }
 else           if (ENodeType.SYSTEM_FOLDER == node.getType()) {
            if (node.getContentType() == ERepositoryObjectType.PROCESS) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STANDARD_GENERIC_CATEGORY_CLOSE_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_STORM) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STREAMING_GENERIC_CATEGORY_CLOSE_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_MR) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_BATCH_GENERIC_CATEGORY_CLOSE_ICON));
            }
          }
        }
      }
    }
    @Override public void treeExpanded(    TreeExpansionEvent event){
      Object element=event.getElement();
      if (element instanceof RepositoryNode) {
        RepositoryNode node=(RepositoryNode)element;
        TreeItem item=getObject(viewer.getTree(),event.getElement());
        if (item != null) {
          if (node.getType().equals(ENodeType.SIMPLE_FOLDER)) {
            item.setImage(ImageProvider.getImage(ECoreImage.FOLDER_OPEN_ICON));
          }
 else           if (ENodeType.SYSTEM_FOLDER == node.getType()) {
            if (node.getContentType() == ERepositoryObjectType.PROCESS) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STANDARD_GENERIC_CATEGORY_OPEN_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_STORM) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STREAMING_GENERIC_CATEGORY_OPEN_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_MR) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_BATCH_GENERIC_CATEGORY_OPEN_ICON));
            }
          }
        }
      }
    }
  }
);
  createTreeTooltip(viewer.getTree());
  viewer.getTree().addFocusListener(new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
      log.trace("String_Node_Str");
      IContextService contextService=(IContextService)RepositoryViewPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
      ca=contextService.activateContext("String_Node_Str");
    }
    @Override public void focusLost(    FocusEvent e){
      log.trace("String_Node_Str");
      if (ca != null) {
        IContextService contextService=(IContextService)RepositoryViewPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
        contextService.deactivateContext(ca);
      }
    }
  }
);
  if (listenersNeedTobeAddedIntoTreeviewer.size() > 0) {
    for (    ISelectionChangedListener listener : listenersNeedTobeAddedIntoTreeviewer) {
      viewer.addSelectionChangedListener(listener);
    }
    listenersNeedTobeAddedIntoTreeviewer.clear();
  }
  CoreRepositoryPlugin.getDefault().registerRepositoryChangedListenerAsFirst(this);
  if (!CoreRepositoryPlugin.getDefault().isRCPMode()) {
    boolean pluginModel=true;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IMigrationToolService.class)) {
      IMigrationToolService migrationService=(IMigrationToolService)GlobalServiceRegister.getDefault().getService(IMigrationToolService.class);
      if (migrationService != null) {
        migrationService.executeMigration(pluginModel);
      }
    }
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
      IRunProcessService runProcessService=(IRunProcessService)GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
      if (runProcessService != null) {
        runProcessService.deleteAllJobs(pluginModel);
      }
    }
    final RepositoryContext repositoryContext=(RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
    final Project project=repositoryContext.getProject();
    final IWorkbenchWindow activedWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    activedWorkbenchWindow.getPartService().addPartListener(new IPartListener(){
      @Override public void partActivated(      IWorkbenchPart part){
        if (part instanceof RepoViewCommonNavigator) {
          String title=activedWorkbenchWindow.getShell().getText();
          if (!title.contains("String_Node_Str")) {
            title+="String_Node_Str" + repositoryContext.getUser() + "String_Node_Str"+ project.getLabel();
            activedWorkbenchWindow.getShell().setText(title);
          }
        }
      }
      @Override public void partBroughtToTop(      IWorkbenchPart part){
      }
      @Override public void partClosed(      IWorkbenchPart part){
      }
      @Override public void partDeactivated(      IWorkbenchPart part){
      }
      @Override public void partOpened(      IWorkbenchPart part){
        if (part instanceof RepoViewCommonNavigator) {
          String title=activedWorkbenchWindow.getShell().getText();
          if (!title.contains("String_Node_Str")) {
            title+="String_Node_Str" + repositoryContext.getUser() + "String_Node_Str"+ project.getLabel();
            activedWorkbenchWindow.getShell().setText(title);
          }
        }
      }
    }
);
  }
  expandTreeRootIfOnlyOneRoot();
  viewer.setSorter(new CommonViewerSorter());
  refreshContentDescription();
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(getRepoViewPerspectiveListener());
  RepositoryNodeFilterHelper.filter(viewer,RepositoryNodeFilterHelper.isActivedFilter(),PerspectiveFilterHelper.isActivedPerspectiveFilter());
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(getRepoViewPartListener());
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  if (workspace != null) {
    workspace.addResourceChangeListener(getResourcePostChangerRunnableListener(),IResourceChangeEvent.POST_CHANGE);
  }
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  service=GitContentServiceProviderManager.getGitContentService();
  if (service != null && service.isGIT())   service.createDropdownCombo(parent);
  super.createPartControl(parent);
  viewer=getCommonViewer();
  if (service != null && service.isGIT())   viewer.getTree().addListener(SWT.Resize,new Listener(){
    @Override public void handleEvent(    Event event){
      Point point=parent.getSize();
      viewer.getTree().setSize(point.x,point.y - 42);
    }
  }
);
  if (viewer instanceof ITreeViewerListener) {
    viewer.addTreeListener((ITreeViewerListener)viewer);
  }
  getSite().setSelectionProvider(viewer);
  viewer.addTreeListener(new ITreeViewerListener(){
    @Override public void treeCollapsed(    TreeExpansionEvent event){
      Object element=event.getElement();
      if (element instanceof RepositoryNode) {
        RepositoryNode node=(RepositoryNode)element;
        TreeItem item=getObject(viewer.getTree(),event.getElement());
        if (item != null) {
          if (node.getType().equals(ENodeType.SIMPLE_FOLDER)) {
            item.setImage(ImageProvider.getImage(ECoreImage.FOLDER_CLOSE_ICON));
          }
 else           if (ENodeType.SYSTEM_FOLDER == node.getType()) {
            if (node.getContentType() == ERepositoryObjectType.PROCESS) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STANDARD_GENERIC_CATEGORY_CLOSE_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_STORM) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STREAMING_GENERIC_CATEGORY_CLOSE_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_MR) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_BATCH_GENERIC_CATEGORY_CLOSE_ICON));
            }
          }
        }
      }
    }
    @Override public void treeExpanded(    TreeExpansionEvent event){
      Object element=event.getElement();
      if (element instanceof RepositoryNode) {
        RepositoryNode node=(RepositoryNode)element;
        TreeItem item=getObject(viewer.getTree(),event.getElement());
        if (item != null) {
          if (node.getType().equals(ENodeType.SIMPLE_FOLDER)) {
            item.setImage(ImageProvider.getImage(ECoreImage.FOLDER_OPEN_ICON));
          }
 else           if (ENodeType.SYSTEM_FOLDER == node.getType()) {
            if (node.getContentType() == ERepositoryObjectType.PROCESS) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STANDARD_GENERIC_CATEGORY_OPEN_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_STORM) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_STREAMING_GENERIC_CATEGORY_OPEN_ICON));
            }
 else             if (node.getContentType() == ERepositoryObjectType.PROCESS_MR) {
              item.setImage(ImageProvider.getImage(ECoreImage.PROCESS_BATCH_GENERIC_CATEGORY_OPEN_ICON));
            }
          }
        }
      }
    }
  }
);
  createTreeTooltip(viewer.getTree());
  viewer.getTree().addFocusListener(new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
      log.trace("String_Node_Str");
      IContextService contextService=(IContextService)RepositoryViewPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
      ca=contextService.activateContext("String_Node_Str");
    }
    @Override public void focusLost(    FocusEvent e){
      log.trace("String_Node_Str");
      if (ca != null) {
        IContextService contextService=(IContextService)RepositoryViewPlugin.getDefault().getWorkbench().getAdapter(IContextService.class);
        contextService.deactivateContext(ca);
      }
    }
  }
);
  if (listenersNeedTobeAddedIntoTreeviewer.size() > 0) {
    for (    ISelectionChangedListener listener : listenersNeedTobeAddedIntoTreeviewer) {
      viewer.addSelectionChangedListener(listener);
    }
    listenersNeedTobeAddedIntoTreeviewer.clear();
  }
  CoreRepositoryPlugin.getDefault().registerRepositoryChangedListenerAsFirst(this);
  if (!CoreRepositoryPlugin.getDefault().isRCPMode()) {
    boolean pluginModel=true;
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IMigrationToolService.class)) {
      IMigrationToolService migrationService=(IMigrationToolService)GlobalServiceRegister.getDefault().getService(IMigrationToolService.class);
      if (migrationService != null) {
        migrationService.executeMigration(pluginModel);
      }
    }
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
      IRunProcessService runProcessService=(IRunProcessService)GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
      if (runProcessService != null) {
        runProcessService.deleteAllJobs(pluginModel);
      }
    }
    final RepositoryContext repositoryContext=(RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
    final Project project=repositoryContext.getProject();
    final IWorkbenchWindow activedWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    activedWorkbenchWindow.getPartService().addPartListener(new IPartListener(){
      @Override public void partActivated(      IWorkbenchPart part){
        if (part instanceof RepoViewCommonNavigator) {
          String title=activedWorkbenchWindow.getShell().getText();
          if (!title.contains("String_Node_Str")) {
            title+="String_Node_Str" + repositoryContext.getUser() + "String_Node_Str"+ project.getLabel();
            activedWorkbenchWindow.getShell().setText(title);
          }
        }
      }
      @Override public void partBroughtToTop(      IWorkbenchPart part){
      }
      @Override public void partClosed(      IWorkbenchPart part){
      }
      @Override public void partDeactivated(      IWorkbenchPart part){
      }
      @Override public void partOpened(      IWorkbenchPart part){
        if (part instanceof RepoViewCommonNavigator) {
          String title=activedWorkbenchWindow.getShell().getText();
          if (!title.contains("String_Node_Str")) {
            title+="String_Node_Str" + repositoryContext.getUser() + "String_Node_Str"+ project.getLabel();
            activedWorkbenchWindow.getShell().setText(title);
          }
        }
      }
    }
);
  }
  expandTreeRootIfOnlyOneRoot();
  viewer.setSorter(new CommonViewerSorter());
  refreshContentDescription();
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(getRepoViewPerspectiveListener());
  RepositoryNodeFilterHelper.filter(viewer,RepositoryNodeFilterHelper.isActivedFilter(),PerspectiveFilterHelper.isActivedPerspectiveFilter());
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(getRepoViewPartListener());
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  if (workspace != null) {
    workspace.addResourceChangeListener(getResourcePostChangerRunnableListener(),IResourceChangeEvent.POST_CHANGE);
  }
}