Program: 148028
Project: 148028
Buggy source:
/** 
 * DOC Comment method "setPerspectiveTabs".
 */
public static void setPerspectiveTabs(){
  IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  PerspectiveBarManager barManager=((WorkbenchWindow)activeWorkbenchWindow).getPerspectiveBar();
  if (barManager != null && (barManager instanceof PerspectiveBarManager)) {
    IContributionItem iconItem=barManager.find(PERSPECTIVE_DI_ID);
    if (null == iconItem) {
      IPerspectiveDescriptor diMailPerspective=WorkbenchPlugin.getDefault().getPerspectiveRegistry().findPerspectiveWithId(PERSPECTIVE_DI_ID);
      if (null != diMailPerspective && (diMailPerspective instanceof IPerspectiveDescriptor)) {
        PerspectiveBarContributionItem diItem=new PerspectiveBarContributionItem(diMailPerspective,activeWorkbenchWindow.getActivePage());
        if (null != diItem && (diItem instanceof PerspectiveBarContributionItem)) {
          barManager.addItem(diItem);
        }
      }
    }
    iconItem=barManager.find(PERSPECTIVE_DQ_ID);
    if (null == iconItem) {
      IPerspectiveDescriptor dqMailPerspective=WorkbenchPlugin.getDefault().getPerspectiveRegistry().findPerspectiveWithId(PERSPECTIVE_DQ_ID);
      if (null != dqMailPerspective && (dqMailPerspective instanceof IPerspectiveDescriptor)) {
        PerspectiveBarContributionItem dqItem=new PerspectiveBarContributionItem(dqMailPerspective,activeWorkbenchWindow.getActivePage());
        if (null != dqItem && (dqItem instanceof PerspectiveBarContributionItem)) {
          barManager.addItem(dqItem);
        }
      }
    }
    iconItem=barManager.find(PERSPECTIVE_MDM_ID);
    if (null == iconItem) {
      IPerspectiveDescriptor mdmMailPerspective=WorkbenchPlugin.getDefault().getPerspectiveRegistry().findPerspectiveWithId(PERSPECTIVE_MDM_ID);
      if (null != mdmMailPerspective && (mdmMailPerspective instanceof IPerspectiveDescriptor)) {
        PerspectiveBarContributionItem mdmItem=new PerspectiveBarContributionItem(mdmMailPerspective,activeWorkbenchWindow.getActivePage());
        if (null != mdmItem && (mdmItem instanceof PerspectiveBarContributionItem)) {
          barManager.addItem(mdmItem);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC Comment method "setPerspectiveTabs".
 */
public static void setPerspectiveTabs(){
  IWorkbenchWindow activeWorkbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  PerspectiveBarManager barManager=((WorkbenchWindow)activeWorkbenchWindow).getPerspectiveBar();
  if (barManager != null && (barManager instanceof PerspectiveBarManager)) {
    IContributionItem iconItem=barManager.find(PERSPECTIVE_DI_ID);
    if (null == iconItem) {
      IPerspectiveDescriptor diMailPerspective=WorkbenchPlugin.getDefault().getPerspectiveRegistry().findPerspectiveWithId(PERSPECTIVE_DI_ID);
      if (null != diMailPerspective && (diMailPerspective instanceof IPerspectiveDescriptor)) {
        PerspectiveBarContributionItem diItem=new PerspectiveBarContributionItem(diMailPerspective,activeWorkbenchWindow.getActivePage());
        if (null != diItem && (diItem instanceof PerspectiveBarContributionItem)) {
          barManager.addItem(diItem);
        }
      }
    }
    iconItem=barManager.find(PERSPECTIVE_DQ_ID);
    if (null == iconItem) {
      IPerspectiveDescriptor dqMailPerspective=WorkbenchPlugin.getDefault().getPerspectiveRegistry().findPerspectiveWithId(PERSPECTIVE_DQ_ID);
      if (null != dqMailPerspective && (dqMailPerspective instanceof IPerspectiveDescriptor)) {
        PerspectiveBarContributionItem dqItem=new PerspectiveBarContributionItem(dqMailPerspective,activeWorkbenchWindow.getActivePage());
        if (null != dqItem && (dqItem instanceof PerspectiveBarContributionItem)) {
          barManager.addItem(dqItem);
        }
      }
    }
    iconItem=barManager.find(PERSPECTIVE_MDM_ID);
    if (null == iconItem) {
      IPerspectiveDescriptor mdmMailPerspective=WorkbenchPlugin.getDefault().getPerspectiveRegistry().findPerspectiveWithId(PERSPECTIVE_MDM_ID);
      if (null != mdmMailPerspective && (mdmMailPerspective instanceof IPerspectiveDescriptor)) {
        PerspectiveBarContributionItem mdmItem=new PerspectiveBarContributionItem(mdmMailPerspective,activeWorkbenchWindow.getActivePage());
        if (null != mdmItem && (mdmItem instanceof PerspectiveBarContributionItem)) {
          barManager.addItem(mdmItem);
        }
      }
    }
    iconItem=barManager.find(WORKFLOW_PERSPECTIVE_ID);
    if (null == iconItem) {
      IPerspectiveDescriptor workflowPerspective=WorkbenchPlugin.getDefault().getPerspectiveRegistry().findPerspectiveWithId(WORKFLOW_PERSPECTIVE_ID);
      if (null != workflowPerspective && (workflowPerspective instanceof IPerspectiveDescriptor)) {
        PerspectiveBarContributionItem workflowItem=new PerspectiveBarContributionItem(workflowPerspective,activeWorkbenchWindow.getActivePage());
        if (null != workflowItem && (workflowItem instanceof PerspectiveBarContributionItem)) {
          barManager.addItem(workflowItem);
        }
      }
    }
  }
}