Program: 95001
Project: 95001
Buggy source:
private boolean intelligentAppend(SimpleLinkTextViewer readText,StyledText st,ChatLine text){
  String line=text.getText();
  int index=line.indexOf("String_Node_Str");
  if (index == -1) {
    index=line.indexOf("String_Node_Str");
    if (index == -1) {
      index=line.indexOf("String_Node_Str");
      if (index == -1) {
        return false;
      }
    }
  }
 else {
    int nextIndex=line.indexOf("String_Node_Str");
    if (nextIndex != -1 && nextIndex < index) {
      index=nextIndex;
    }
    nextIndex=line.indexOf("String_Node_Str");
    if (nextIndex != -1 && nextIndex < index) {
      index=nextIndex;
    }
  }
  int startRange=st.getText().length();
  StringBuffer sb=new StringBuffer();
  boolean nickContained=text.getText().indexOf(userName) != -1;
  if (text.getOriginator() != null) {
    nickContained=!text.getOriginator().getName().equals(userName) && nickContained;
    sb.append('(').append(getCurrentDate(DEFAULT_TIME_FORMAT)).append("String_Node_Str");
    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);
  }
  while (index != -1) {
    String front=line.substring(0,index);
    line=line.substring(index);
    int beforeMessageIndex=st.getText().length();
    st.append(front);
    if (text.getOriginator() == null) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=front.length();
      sr.foreground=systemColor;
      sr.fontStyle=SWT.BOLD;
      st.setStyleRange(sr);
    }
 else     if (nickContained) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=front.length();
      sr.foreground=highlightColor;
      st.setStyleRange(sr);
    }
    int spaceIndex=line.indexOf(' ');
    if (spaceIndex != -1) {
      String url=line.substring(0,spaceIndex);
      if (!url.startsWith("String_Node_Str")) {
        readText.appendLink(url,createLinkRunnable("String_Node_Str" + url));
      }
 else {
        readText.appendLink(url,createLinkRunnable(url));
      }
      line=line.substring(spaceIndex);
      index=line.indexOf("String_Node_Str");
      if (index == -1) {
        index=line.indexOf("String_Node_Str");
        if (index == -1) {
          index=line.indexOf("String_Node_Str");
          if (index == -1) {
            return false;
          }
        }
      }
 else {
        int nextIndex=line.indexOf("String_Node_Str");
        if (nextIndex != -1 && nextIndex < index) {
          index=nextIndex;
        }
        nextIndex=line.indexOf("String_Node_Str");
        if (nextIndex != -1 && nextIndex < index) {
          index=nextIndex;
        }
      }
    }
 else {
      if (!line.startsWith("String_Node_Str")) {
        readText.appendLink(line,createLinkRunnable("String_Node_Str" + line));
      }
 else {
        readText.appendLink(line,createLinkRunnable(line));
      }
      line=null;
      break;
    }
  }
  if (line != null && !line.equals("String_Node_Str")) {
    int beforeMessageIndex=st.getText().length();
    st.append(line);
    if (text.getOriginator() == null) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=line.length();
      sr.foreground=systemColor;
      sr.fontStyle=SWT.BOLD;
      st.setStyleRange(sr);
    }
 else     if (nickContained) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=line.length();
      sr.foreground=highlightColor;
      st.setStyleRange(sr);
    }
  }
  if (!text.isNoCRLF()) {
    st.append("String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
private boolean intelligentAppend(SimpleLinkTextViewer readText,StyledText st,ChatLine text){
  String line=text.getText();
  int index=line.indexOf("String_Node_Str");
  if (index == -1) {
    index=line.indexOf("String_Node_Str");
    if (index == -1) {
      index=line.indexOf("String_Node_Str");
      if (index == -1) {
        return false;
      }
    }
  }
 else {
    int nextIndex=line.indexOf("String_Node_Str");
    if (nextIndex != -1 && nextIndex < index) {
      index=nextIndex;
    }
    nextIndex=line.indexOf("String_Node_Str");
    if (nextIndex != -1 && nextIndex < index) {
      index=nextIndex;
    }
  }
  int startRange=st.getText().length();
  StringBuffer sb=new StringBuffer();
  boolean nickContained=text.getText().indexOf(userName) != -1;
  if (text.getOriginator() != null) {
    nickContained=!text.getOriginator().getName().equals(userName) && nickContained;
    sb.append('(').append(getCurrentDate(DEFAULT_TIME_FORMAT)).append("String_Node_Str");
    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);
  }
  while (index != -1) {
    String front=line.substring(0,index);
    line=line.substring(index);
    int beforeMessageIndex=st.getText().length();
    st.append(front);
    if (text.getOriginator() == null) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=front.length();
      sr.foreground=systemColor;
      sr.fontStyle=SWT.BOLD;
      st.setStyleRange(sr);
    }
 else     if (nickContained) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=front.length();
      sr.foreground=highlightColor;
      st.setStyleRange(sr);
    }
    int spaceIndex=line.indexOf(' ');
    if (spaceIndex != -1) {
      String url=line.substring(0,spaceIndex);
      int symbols=0;
      for (int i=url.length() - 1; i != 0; i--) {
        char ch=url.charAt(i);
        if (!Character.isLetterOrDigit(ch)) {
          symbols++;
        }
 else {
          break;
        }
      }
      if (!url.startsWith("String_Node_Str")) {
        if (symbols == 0) {
          readText.appendLink(url,createLinkRunnable("String_Node_Str" + url));
        }
 else {
          int symbolIndex=url.length() - symbols;
          String link=url.substring(0,symbolIndex);
          readText.appendLink(link,createLinkRunnable("String_Node_Str" + link));
          st.append(url.substring(symbolIndex));
        }
      }
 else {
        if (symbols == 0) {
          readText.appendLink(url,createLinkRunnable(url));
        }
 else {
          int symbolIndex=url.length() - symbols;
          String link=url.substring(0,symbolIndex);
          readText.appendLink(link,createLinkRunnable(link));
          st.append(url.substring(symbolIndex));
        }
      }
      line=line.substring(spaceIndex);
      index=line.indexOf("String_Node_Str");
      if (index == -1) {
        index=line.indexOf("String_Node_Str");
        if (index == -1) {
          index=line.indexOf("String_Node_Str");
          if (index == -1) {
            break;
          }
        }
      }
 else {
        int nextIndex=line.indexOf("String_Node_Str");
        if (nextIndex != -1 && nextIndex < index) {
          index=nextIndex;
        }
        nextIndex=line.indexOf("String_Node_Str");
        if (nextIndex != -1 && nextIndex < index) {
          index=nextIndex;
        }
      }
    }
 else {
      int symbols=0;
      for (int i=line.length() - 1; i != 0; i--) {
        char ch=line.charAt(i);
        if (!Character.isLetterOrDigit(ch)) {
          symbols++;
        }
 else {
          break;
        }
      }
      if (!line.startsWith("String_Node_Str")) {
        if (symbols == 0) {
          readText.appendLink(line,createLinkRunnable("String_Node_Str" + line));
        }
 else {
          int symbolIndex=line.length() - symbols;
          String link=line.substring(0,symbolIndex);
          readText.appendLink(link,createLinkRunnable("String_Node_Str" + link));
          st.append(line.substring(symbolIndex));
        }
      }
 else {
        if (symbols == 0) {
          readText.appendLink(line,createLinkRunnable(line));
        }
 else {
          int symbolIndex=line.length() - symbols;
          String link=line.substring(0,symbolIndex);
          readText.appendLink(link,createLinkRunnable(link));
          st.append(line.substring(symbolIndex));
        }
      }
      line=null;
      break;
    }
  }
  if (line != null && !line.equals("String_Node_Str")) {
    int beforeMessageIndex=st.getText().length();
    st.append(line);
    if (text.getOriginator() == null) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=line.length();
      sr.foreground=systemColor;
      sr.fontStyle=SWT.BOLD;
      st.setStyleRange(sr);
    }
 else     if (nickContained) {
      StyleRange sr=new StyleRange();
      sr.start=beforeMessageIndex;
      sr.length=line.length();
      sr.foreground=highlightColor;
      st.setStyleRange(sr);
    }
  }
  if (!text.isNoCRLF()) {
    st.append("String_Node_Str");
  }
  return true;
}