Program: 94617
Project: 94617
Buggy source:
ChatComposite(LineChatClientView view,Composite parent,TableViewer table,String initText,ChatWindow chatWindow){
  super(parent,SWT.NONE);
  this.view=view;
  this.chatWindow=chatWindow;
  setLayout(new FillLayout());
  meColor=colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_ME_TEXT_COLOR));
  otherColor=colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_OTHER_TEXT_COLOR));
  systemColor=colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_SYSTEM_TEXT_COLOR));
  ClientPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new ColorPropertyChangeListener());
  this.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      if (meColor != null) {
        meColor.dispose();
      }
      if (otherColor != null) {
        otherColor.dispose();
      }
      if (systemColor != null) {
        systemColor.dispose();
      }
    }
  }
);
  final SashForm sf=new SashForm(this,SWT.NORMAL);
  sf.setLayout(new FillLayout());
  sf.setOrientation(SWT.VERTICAL);
  tableView=table;
  textoutput=createStyledTextWidget(sf);
  textoutput.setLayoutData(new GridData(SWT.FILL));
  final String fontName=ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT);
  if (!(fontName == null) && !(fontName.equals("String_Node_Str"))) {
    final FontRegistry fr=ClientPlugin.getDefault().getFontRegistry();
    final FontData[] newFont={new FontData(fontName)};
    fr.put(CHAT_OUTPUT_FONT,newFont);
    textoutput.setFont(fr.get(CHAT_OUTPUT_FONT));
  }
  ClientPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new FontPropertyChangeListener());
  textoutput.append(initText);
  textinput=new Text(sf,SWT.SINGLE | SWT.BORDER);
  textinput.setText(TEXT_INPUT_INIT);
  textinput.setLayoutData(new GridData(SWT.FILL));
  textinput.selectAll();
  textinput.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent evt){
      handleKeyPressed(evt);
    }
    public void keyReleased(    KeyEvent evt){
      handleKeyReleased(evt);
    }
  }
);
  textinput.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
      final String t=textinput.getText();
      if (t.equals(TEXT_INPUT_INIT)) {
        textinput.selectAll();
      }
    }
    public void focusLost(    FocusEvent e){
    }
  }
);
  textinput.addMouseListener(new MouseListener(){
    public void mouseDoubleClick(    MouseEvent e){
    }
    public void mouseDown(    MouseEvent e){
    }
    public void mouseUp(    MouseEvent e){
      final String t=textinput.getText();
      if (t.equals(TEXT_INPUT_INIT)) {
        textinput.selectAll();
      }
    }
  }
);
  textinput.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (typing && textinput.getText().trim().length() == 0)       typing=false;
 else       if (!typing) {
        typing=true;
        ChatComposite.this.view.lch.sendStartedTyping();
      }
    }
  }
);
  sf.setWeights(new int[]{90,10});
  makeActions();
  hookContextMenu();
  contributeToActionBars();
  initializeDropTargets();
}

Fixed version (ground truth):
ChatComposite(LineChatClientView view,Composite parent,TableViewer table,String initText,ChatWindow chatWindow){
  super(parent,SWT.NONE);
  this.view=view;
  this.chatWindow=chatWindow;
  setLayout(new FillLayout());
  meColor=colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_ME_TEXT_COLOR));
  otherColor=colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_OTHER_TEXT_COLOR));
  systemColor=colorFromRGBString(ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_SYSTEM_TEXT_COLOR));
  ClientPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new ColorPropertyChangeListener());
  this.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      if (meColor != null) {
        meColor.dispose();
      }
      if (otherColor != null) {
        otherColor.dispose();
      }
      if (systemColor != null) {
        systemColor.dispose();
      }
    }
  }
);
  final Composite chattingComposite=new Composite(this,SWT.NONE);
  GridLayout layout=new GridLayout(1,true);
  layout.marginHeight=0;
  layout.marginWidth=0;
  chattingComposite.setLayout(layout);
  tableView=table;
  textoutput=createStyledTextWidget(chattingComposite);
  textoutput.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  final String fontName=ClientPlugin.getDefault().getPluginPreferences().getString(ClientPlugin.PREF_CHAT_FONT);
  if (!(fontName == null) && !(fontName.equals("String_Node_Str"))) {
    final FontRegistry fr=ClientPlugin.getDefault().getFontRegistry();
    final FontData[] newFont={new FontData(fontName)};
    fr.put(CHAT_OUTPUT_FONT,newFont);
    textoutput.setFont(fr.get(CHAT_OUTPUT_FONT));
  }
  ClientPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(new FontPropertyChangeListener());
  textoutput.append(initText);
  textinput=new Text(chattingComposite,SWT.SINGLE | SWT.BORDER);
  textinput.setText(TEXT_INPUT_INIT);
  GridData gd=new GridData(SWT.FILL,SWT.CENTER,true,false);
  GC gc=new GC(textinput);
  gc.setFont(textinput.getFont());
  FontMetrics fontMetrics=gc.getFontMetrics();
  gc.dispose();
  gd.heightHint=fontMetrics.getHeight() * 2;
  textinput.setLayoutData(gd);
  textinput.selectAll();
  textinput.addKeyListener(new KeyListener(){
    public void keyPressed(    KeyEvent evt){
      handleKeyPressed(evt);
    }
    public void keyReleased(    KeyEvent evt){
      handleKeyReleased(evt);
    }
  }
);
  textinput.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
      final String t=textinput.getText();
      if (t.equals(TEXT_INPUT_INIT)) {
        textinput.selectAll();
      }
    }
    public void focusLost(    FocusEvent e){
    }
  }
);
  textinput.addMouseListener(new MouseListener(){
    public void mouseDoubleClick(    MouseEvent e){
    }
    public void mouseDown(    MouseEvent e){
    }
    public void mouseUp(    MouseEvent e){
      final String t=textinput.getText();
      if (t.equals(TEXT_INPUT_INIT)) {
        textinput.selectAll();
      }
    }
  }
);
  textinput.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (typing && textinput.getText().trim().length() == 0)       typing=false;
 else       if (!typing) {
        typing=true;
        ChatComposite.this.view.lch.sendStartedTyping();
      }
    }
  }
);
  makeActions();
  hookContextMenu();
  contributeToActionBars();
  initializeDropTargets();
}