Program: 140676
Project: 140676
Buggy source:
@Override protected void fillCoolBar(ICoolBarManager coolBar){
  IToolBarManager toolbar=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  coolBar.add(new ToolBarContributionItem(toolbar,"String_Node_Str"));
  toolbar.add(ActionFactory.SAVE.create(window));
  toolbar.add(new ChangePerspectiveAction(true));
  runAnalysisAction=new RunAnalysisAction();
  toolbar.add(runAnalysisAction);
  final IWorkbenchWindow activeWorkbenchWindow=getActionBarConfigurer().getWindowConfigurer().getWindow();
  if (activeWorkbenchWindow != null) {
    activeWorkbenchWindow.getPartService().addPartListener(new IPartListener(){
      public void partActivated(      IWorkbenchPart part){
        boolean isEnable=false;
        if (part instanceof AnalysisEditor) {
          isEnable=true;
        }
 else {
          IWorkbenchPage activePage=activeWorkbenchWindow.getActivePage();
          if (activePage != null) {
            IEditorPart activeEditor=activePage.getActiveEditor();
            if (activeEditor instanceof AnalysisEditor) {
              isEnable=true;
            }
          }
        }
        runAnalysisAction.setEnabled(isEnable);
      }
      public void partBroughtToTop(      IWorkbenchPart part){
        if (part instanceof AnalysisEditor) {
          runAnalysisAction.setEnabled(true);
        }
 else {
          runAnalysisAction.setEnabled(false);
        }
      }
      public void partClosed(      IWorkbenchPart part){
      }
      public void partDeactivated(      IWorkbenchPart part){
      }
      public void partOpened(      IWorkbenchPart part){
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void fillCoolBar(ICoolBarManager coolBar){
  IToolBarManager toolbar=new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  coolBar.add(new ToolBarContributionItem(toolbar,"String_Node_Str"));
  toolbar.add(new ChangePerspectiveAction(true));
  toolbar.add(ActionFactory.SAVE.create(window));
  runAnalysisAction=new RunAnalysisAction(true);
  toolbar.add(runAnalysisAction);
  refreshChartAction=new RefreshChartAction();
  toolbar.add(refreshChartAction);
  final IWorkbenchWindow activeWorkbenchWindow=getActionBarConfigurer().getWindowConfigurer().getWindow();
  if (activeWorkbenchWindow != null) {
    activeWorkbenchWindow.getPartService().addPartListener(new IPartListener(){
      public void partActivated(      IWorkbenchPart part){
        boolean isEnable=false;
        if (part instanceof AnalysisEditor) {
          isEnable=true;
        }
 else {
          IWorkbenchPage activePage=activeWorkbenchWindow.getActivePage();
          if (activePage != null) {
            IEditorPart activeEditor=activePage.getActiveEditor();
            if (activeEditor instanceof AnalysisEditor) {
              isEnable=true;
            }
          }
        }
        runAnalysisAction.setEnabled(isEnable);
        refreshChartAction.setEnabled(isEnable);
      }
      public void partBroughtToTop(      IWorkbenchPart part){
        if (part instanceof AnalysisEditor) {
          runAnalysisAction.setEnabled(true);
          refreshChartAction.setEnabled(true);
        }
 else {
          runAnalysisAction.setEnabled(false);
          refreshChartAction.setEnabled(false);
        }
      }
      public void partClosed(      IWorkbenchPart part){
      }
      public void partDeactivated(      IWorkbenchPart part){
      }
      public void partOpened(      IWorkbenchPart part){
      }
    }
);
  }
}