Program: 139579
Project: 139579
Buggy source:
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  MenuManager menuMgr=new MenuManager("String_Node_Str");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      ISelection selection=getCommonViewer().getSelection();
      getNavigatorActionService().setContext(new ActionContext(selection));
      getNavigatorActionService().fillContextMenu(manager);
    }
  }
);
  commonViewer=getCommonViewer();
  Menu menu=menuMgr.createContextMenu(commonViewer.getTree());
  commonViewer.getTree().setMenu(menu);
  this.addViewerFilter(EMFObjFilter.FILTER_ID);
  this.addViewerFilter(ReportingFilter.FILTER_ID);
  this.addViewerFilter(FolderObjFilter.FILTER_ID);
  adjustFilter();
  activateContext();
  this.getCommonViewer().setSorter(null);
  this.getCommonViewer().getTree().addTreeListener(new TreeAdapter(){
    @Override public void treeExpanded(    TreeEvent e){
      TreeItem item=(TreeItem)e.item;
      if (!item.getText().endsWith("String_Node_Str")) {
        Object obj=item.getData();
        if (obj instanceof TableFolderNode || obj instanceof ViewFolderNode || obj instanceof ColumnFolderNode) {
          item.setText(item.getText() + "String_Node_Str" + item.getItemCount()+ "String_Node_Str");
        }
      }
      super.treeExpanded(e);
    }
  }
);
  this.getCommonViewer().getTree().addMouseListener(new MouseAdapter(){
    @Override public void mouseDoubleClick(    MouseEvent e){
      Tree tree=(Tree)e.getSource();
      Point point=new Point(e.x,e.y);
      TreeItem item=tree.getItem(point);
      if (item != null) {
        Object obj=item.getData();
        if (obj instanceof AbstractFolderNode) {
          AbstractFolderNode node=(AbstractFolderNode)obj;
          node.loadChildren();
          Object[] children=node.getChildren();
          if (children != null) {
            if (item.getText().indexOf("String_Node_Str") > 0) {
              item.setText(item.getText().substring(0,item.getText().indexOf("String_Node_Str")) + "String_Node_Str" + children.length+ "String_Node_Str");
            }
 else {
              item.setText(item.getText() + "String_Node_Str" + children.length+ "String_Node_Str");
            }
          }
        }
        if (obj instanceof Analysis) {
          Analysis analysis=(Analysis)obj;
          List<RenderedObject> tempList=new ArrayList<RenderedObject>();
          tempList.add(analysis);
          IFolder analysesFolder=ResourceManager.getDataProfilingFolder().getFolder(DQStructureManager.ANALYSIS);
          IFile file=AnaResourceFileHelper.getInstance().findCorrespondingFile(tempList,analysesFolder).get(0);
          CorePlugin.getDefault().openEditor(file,"String_Node_Str");
        }
        if (obj instanceof IndicatorDefinition) {
          IndicatorDefinition indicatorDefinition=(IndicatorDefinition)obj;
          IndicatorEditorInput input=new IndicatorEditorInput(indicatorDefinition);
          try {
            CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input,IndicatorEditor.class.getName());
          }
 catch (          PartInitException e1) {
            log.error(e1,e1);
          }
        }
      }
      super.mouseDoubleClick(e);
    }
  }
);
  commonViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      TreeSelection selection=(TreeSelection)event.getSelection();
      if (selection.size() != 1) {
        return;
      }
      Object selectedElement=selection.getFirstElement();
      if (selectedElement instanceof TdTable || selectedElement instanceof TdView) {
        if (provider == null) {
          provider=(ITreeContentProvider)commonViewer.getContentProvider();
        }
        for (        Object child : provider.getChildren(selectedElement)) {
          if (child instanceof IFolderNode && ((IFolderNode)child).getFolderNodeType() == ColumnFolderNode.COLUMNFOLDER_NODE_TYPE) {
            ((IFolderNode)child).loadChildren();
            break;
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  MenuManager menuMgr=new MenuManager("String_Node_Str");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      ISelection selection=getCommonViewer().getSelection();
      getNavigatorActionService().setContext(new ActionContext(selection));
      getNavigatorActionService().fillContextMenu(manager);
    }
  }
);
  commonViewer=getCommonViewer();
  Menu menu=menuMgr.createContextMenu(commonViewer.getTree());
  commonViewer.getTree().setMenu(menu);
  this.addViewerFilter(EMFObjFilter.FILTER_ID);
  this.addViewerFilter(ReportingFilter.FILTER_ID);
  this.addViewerFilter(FolderObjFilter.FILTER_ID);
  adjustFilter();
  activateContext();
  this.getCommonViewer().setSorter(null);
  this.getCommonViewer().getTree().addTreeListener(new TreeAdapter(){
    @Override public void treeExpanded(    TreeEvent e){
      TreeItem item=(TreeItem)e.item;
      if (!item.getText().endsWith("String_Node_Str")) {
        Object obj=item.getData();
        if (obj instanceof TableFolderNode || obj instanceof ViewFolderNode || obj instanceof ColumnFolderNode) {
          item.setText(item.getText() + "String_Node_Str" + item.getItemCount()+ "String_Node_Str");
        }
      }
      super.treeExpanded(e);
    }
  }
);
  this.getCommonViewer().getTree().addMouseListener(new MouseAdapter(){
    @Override public void mouseDoubleClick(    MouseEvent e){
      Tree tree=(Tree)e.getSource();
      Point point=new Point(e.x,e.y);
      TreeItem item=tree.getItem(point);
      if (item != null) {
        Object obj=item.getData();
        if (obj instanceof AbstractFolderNode) {
          AbstractFolderNode node=(AbstractFolderNode)obj;
          node.loadChildren();
          Object[] children=node.getChildren();
          if (children != null) {
            if (item.getText().indexOf("String_Node_Str") > 0) {
              item.setText(item.getText().substring(0,item.getText().indexOf("String_Node_Str")) + "String_Node_Str" + children.length+ "String_Node_Str");
            }
 else {
              item.setText(item.getText() + "String_Node_Str" + children.length+ "String_Node_Str");
            }
          }
        }
        if (obj instanceof Analysis) {
          Analysis analysis=(Analysis)obj;
          List<RenderedObject> tempList=new ArrayList<RenderedObject>();
          tempList.add(analysis);
          IFolder analysesFolder=ResourceManager.getDataProfilingFolder().getFolder(DQStructureManager.ANALYSIS);
          IFile file=AnaResourceFileHelper.getInstance().findCorrespondingFile(tempList,analysesFolder).get(0);
          CorePlugin.getDefault().openEditor(file,"String_Node_Str");
        }
        if (obj instanceof IndicatorDefinition) {
          IndicatorDefinition indicatorDefinition=(IndicatorDefinition)obj;
          indicatorDefinition=DefinitionHandler.getInstance().getIndicatorDefinition(indicatorDefinition.getLabel());
          IndicatorEditorInput input=new IndicatorEditorInput(indicatorDefinition);
          try {
            CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input,IndicatorEditor.class.getName());
          }
 catch (          PartInitException e1) {
            log.error(e1,e1);
          }
        }
      }
      super.mouseDoubleClick(e);
    }
  }
);
  commonViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      TreeSelection selection=(TreeSelection)event.getSelection();
      if (selection.size() != 1) {
        return;
      }
      Object selectedElement=selection.getFirstElement();
      if (selectedElement instanceof TdTable || selectedElement instanceof TdView) {
        if (provider == null) {
          provider=(ITreeContentProvider)commonViewer.getContentProvider();
        }
        for (        Object child : provider.getChildren(selectedElement)) {
          if (child instanceof IFolderNode && ((IFolderNode)child).getFolderNodeType() == ColumnFolderNode.COLUMNFOLDER_NODE_TYPE) {
            ((IFolderNode)child).loadChildren();
            break;
          }
        }
      }
    }
  }
);
}