Program: 94926
Project: 94926
Buggy source:
protected void appendText(StyledText st,ChatLine text){
  if (st == null || text == null) {
    return;
  }
  int startRange=st.getText().length();
  StringBuffer sb=new StringBuffer();
  boolean nickContained=text.getText().indexOf(localUserName) != -1;
  if (text.getOriginator() != null) {
    nickContained=!text.getOriginator().getName().equals(localUserName) && nickContained;
    sb.append(NLS.bind(Messages.ChatRoomManagerView_MESSAGE_DATE,getCurrentDate(DEFAULT_TIME_FORMAT)));
    StyleRange dateStyle=new StyleRange();
    dateStyle.start=startRange;
    dateStyle.length=sb.length();
    dateStyle.foreground=dateColor;
    dateStyle.fontStyle=SWT.NORMAL;
    st.append(sb.toString());
    st.setStyleRange(dateStyle);
    sb=new StringBuffer();
    sb.append(text.getOriginator().getName()).append("String_Node_Str");
    StyleRange sr=new StyleRange();
    sr.start=startRange + dateStyle.length;
    sr.length=sb.length();
    sr.fontStyle=SWT.BOLD;
    sr.foreground=nickContained ? highlightColor : otherColor;
    st.append(sb.toString());
    st.setStyleRange(sr);
  }
  int beforeMessageIndex=st.getText().length();
  st.append(text.getText());
  if (text.getOriginator() == null) {
    StyleRange sr=new StyleRange();
    sr.start=beforeMessageIndex;
    sr.length=text.getText().length();
    sr.foreground=systemColor;
    sr.fontStyle=SWT.BOLD;
    st.setStyleRange(sr);
  }
 else   if (nickContained) {
    StyleRange sr=new StyleRange();
    sr.start=beforeMessageIndex;
    sr.length=text.getText().length();
    sr.foreground=highlightColor;
    st.setStyleRange(sr);
  }
  if (!text.isNoCRLF()) {
    st.append("String_Node_Str");
  }
  String t=st.getText();
  if (t == null)   return;
  st.setSelection(t.length());
  IWorkbenchSiteProgressService pservice=(IWorkbenchSiteProgressService)this.getSite().getAdapter(IWorkbenchSiteProgressService.class);
  pservice.warnOfContentChange();
}

Fixed version (ground truth):
protected void appendText(StyledText st,ChatLine text){
  if (st == null || text == null) {
    return;
  }
  boolean scrollToBottom=shouldScrollToEnd(st);
  int startRange=st.getText().length();
  StringBuffer sb=new StringBuffer();
  boolean nickContained=text.getText().indexOf(localUserName) != -1;
  if (text.getOriginator() != null) {
    nickContained=!text.getOriginator().getName().equals(localUserName) && nickContained;
    sb.append(NLS.bind(Messages.ChatRoomManagerView_MESSAGE_DATE,getCurrentDate(DEFAULT_TIME_FORMAT)));
    StyleRange dateStyle=new StyleRange();
    dateStyle.start=startRange;
    dateStyle.length=sb.length();
    dateStyle.foreground=dateColor;
    dateStyle.fontStyle=SWT.NORMAL;
    st.append(sb.toString());
    st.setStyleRange(dateStyle);
    sb=new StringBuffer();
    sb.append(text.getOriginator().getName()).append("String_Node_Str");
    StyleRange sr=new StyleRange();
    sr.start=startRange + dateStyle.length;
    sr.length=sb.length();
    sr.fontStyle=SWT.BOLD;
    sr.foreground=nickContained ? highlightColor : otherColor;
    st.append(sb.toString());
    st.setStyleRange(sr);
  }
  int beforeMessageIndex=st.getText().length();
  st.append(text.getText());
  if (text.getOriginator() == null) {
    StyleRange sr=new StyleRange();
    sr.start=beforeMessageIndex;
    sr.length=text.getText().length();
    sr.foreground=systemColor;
    sr.fontStyle=SWT.BOLD;
    st.setStyleRange(sr);
  }
 else   if (nickContained) {
    StyleRange sr=new StyleRange();
    sr.start=beforeMessageIndex;
    sr.length=text.getText().length();
    sr.foreground=highlightColor;
    st.setStyleRange(sr);
  }
  if (!text.isNoCRLF()) {
    st.append("String_Node_Str");
  }
  String t=st.getText();
  if (t == null)   return;
  if (scrollToBottom)   st.setSelection(t.length());
  IWorkbenchSiteProgressService pservice=(IWorkbenchSiteProgressService)this.getSite().getAdapter(IWorkbenchSiteProgressService.class);
  pservice.warnOfContentChange();
}