Program: 64187
Project: 64187
Buggy source:
/** 
 * Logs a message, if the priority is suitable. In non-emacs mode, task level messages are prefixed by the task name which is right-justified.
 * @param event A BuildEvent containing message information.Must not be <code>null</code>.
 */
public void messageLogged(BuildEvent event){
  int priority=event.getPriority();
  if (priority <= msgOutputLevel) {
    StringBuffer message=new StringBuffer();
    if (event.getTask() != null && !emacsMode) {
      String name=event.getTask().getTaskName();
      String label="String_Node_Str" + name + "String_Node_Str";
      int size=LEFT_COLUMN_SIZE - label.length();
      StringBuffer tmp=new StringBuffer();
      for (int i=0; i < size; i++) {
        tmp.append("String_Node_Str");
      }
      tmp.append(label);
      label=tmp.toString();
      try {
        BufferedReader r=new BufferedReader(new StringReader(event.getMessage()));
        String line=r.readLine();
        boolean first=true;
        while (line != null) {
          if (!first) {
            message.append(StringUtils.LINE_SEP);
          }
          first=false;
          message.append(label).append(line);
          line=r.readLine();
        }
      }
 catch (      IOException e) {
        message.append(label).append(event.getMessage());
      }
    }
 else {
      message.append(event.getMessage());
    }
    String msg=message.toString();
    if (priority != Project.MSG_ERR) {
      printMessage(msg,out,priority);
    }
 else {
      printMessage(msg,err,priority);
    }
    log(msg);
  }
}

Fixed version (ground truth):
/** 
 * Logs a message, if the priority is suitable. In non-emacs mode, task level messages are prefixed by the task name which is right-justified.
 * @param event A BuildEvent containing message information.Must not be <code>null</code>.
 */
public void messageLogged(BuildEvent event){
  int priority=event.getPriority();
  if (priority <= msgOutputLevel) {
    StringBuffer message=new StringBuffer();
    if (event.getTask() != null && !emacsMode) {
      String name=event.getTask().getTaskName();
      String label="String_Node_Str" + name + "String_Node_Str";
      int size=LEFT_COLUMN_SIZE - label.length();
      StringBuffer tmp=new StringBuffer();
      for (int i=0; i < size; i++) {
        tmp.append("String_Node_Str");
      }
      tmp.append(label);
      label=tmp.toString();
      try {
        BufferedReader r=new BufferedReader(new StringReader(event.getMessage()));
        String line=r.readLine();
        boolean first=true;
        do {
          if (first) {
            if (line == null) {
              message.append(label);
              break;
            }
          }
 else {
            message.append(StringUtils.LINE_SEP);
          }
          first=false;
          message.append(label).append(line);
          line=r.readLine();
        }
 while (line != null);
      }
 catch (      IOException e) {
        message.append(label).append(event.getMessage());
      }
    }
 else {
      message.append(event.getMessage());
    }
    String msg=message.toString();
    if (priority != Project.MSG_ERR) {
      printMessage(msg,out,priority);
    }
 else {
      printMessage(msg,err,priority);
    }
    log(msg);
  }
}