Program: 94965
Project: 94965
Buggy source:
public void createPartControl(Composite parent){
  tabFolder=new CTabFolder(parent,SWT.NONE);
  tabFolder.setTabPosition(SWT.BOTTOM);
  toolkit=new FormToolkit(tabFolder.getDisplay());
  tabFolder.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      Iterator it=tabs.values().iterator();
      while (it.hasNext()) {
        ChatTab tab=(ChatTab)it.next();
        if (tab.item == e.item) {
          tab.switchItem.getAction().setChecked(true);
          tab.inputText.setFocus();
        }
 else {
          tab.switchItem.getAction().setChecked(false);
        }
      }
    }
  }
);
  IMenuManager manager=getViewSite().getActionBars().getMenuManager();
  IAction timestampAction=new Action(Messages.MessagesView_ShowTimestamps,IAction.AS_CHECK_BOX){
    public void run(){
      showTimestamps=!showTimestamps;
    }
  }
;
  timestampAction.setChecked(true);
  IAction clearChatLogAction=new Action(Messages.MessagesView_ClearChatLog){
    public void run(){
      CTabItem item=tabFolder.getSelection();
      if (item != null) {
        Iterator iterator=tabs.values().iterator();
        while (iterator.hasNext()) {
          ChatTab tab=(ChatTab)iterator.next();
          if (tab.item == item) {
            if (MessageDialog.openConfirm(tabFolder.getShell(),Messages.MessagesView_ClearChatLogDialogTitle,NLS.bind(Messages.MessagesView_ClearChatLogDialogMessage,MessagesView.getUserName(tab.remoteID)))) {
synchronized (tab) {
                tab.chatText.setText("String_Node_Str");
              }
            }
            return;
          }
        }
      }
    }
  }
;
  manager.add(clearChatLogAction);
  manager.add(timestampAction);
  redColor=new Color(parent.getDisplay(),255,0,0);
  blueColor=new Color(parent.getDisplay(),0,0,255);
}

Fixed version (ground truth):
public void createPartControl(Composite parent){
  tabFolder=new CTabFolder(parent,SWT.CLOSE);
  tabFolder.setTabPosition(SWT.BOTTOM);
  tabFolder.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      Iterator it=tabs.values().iterator();
      while (it.hasNext()) {
        ChatTab tab=(ChatTab)it.next();
        if (tab.item == e.item) {
          tab.inputText.setFocus();
          break;
        }
      }
    }
  }
);
  IMenuManager manager=getViewSite().getActionBars().getMenuManager();
  IAction timestampAction=new Action(Messages.MessagesView_ShowTimestamps,IAction.AS_CHECK_BOX){
    public void run(){
      showTimestamps=!showTimestamps;
    }
  }
;
  timestampAction.setChecked(true);
  IAction clearChatLogAction=new Action(Messages.MessagesView_ClearChatLog){
    public void run(){
      CTabItem item=tabFolder.getSelection();
      if (item != null) {
        Iterator iterator=tabs.values().iterator();
        while (iterator.hasNext()) {
          ChatTab tab=(ChatTab)iterator.next();
          if (tab.item == item) {
            if (MessageDialog.openConfirm(tabFolder.getShell(),Messages.MessagesView_ClearChatLogDialogTitle,NLS.bind(Messages.MessagesView_ClearChatLogDialogMessage,getUserName(tab.remoteID)))) {
synchronized (tab) {
                tab.chatText.setText("String_Node_Str");
              }
            }
            return;
          }
        }
      }
    }
  }
;
  manager.add(clearChatLogAction);
  manager.add(timestampAction);
  redColor=new Color(parent.getDisplay(),255,0,0);
  blueColor=new Color(parent.getDisplay(),0,0,255);
}