Program: 100763
Project: 100763
Buggy source:
/** 
 * @param event event
 * @see org.apache.tools.ant.BuildListener#messageLogged(org.apache.tools.ant.BuildEvent)
 */
@Override public void messageLogged(final BuildEvent event){
  final int priority=event.getPriority();
  if (priority > msgOutputLevel) {
    return;
  }
  final StringBuffer message=new StringBuffer();
  final Task eventTask=event.getTask();
  if (eventTask != null) {
    final String label=new StringBuffer().append("String_Node_Str").append(eventTask.getTaskName()).append("String_Node_Str").toString();
    BufferedReader r=null;
    try {
      String line;
      boolean first=true;
      r=new BufferedReader(new StringReader(event.getMessage()));
      line=r.readLine();
      while (line != null) {
        if (!first) {
          message.append(StringUtils.LINE_SEP);
        }
        first=false;
        message.append(label).append(line);
        line=r.readLine();
      }
    }
 catch (    final IOException e) {
      message.append(label).append(event.getMessage());
    }
 finally {
      try {
        r.close();
      }
 catch (      final IOException ioe) {
      }
    }
  }
 else {
    message.append(event.getMessage());
  }
  final String msg=message.toString();
  catchHHCError(msg);
  if (priority != Project.MSG_ERR) {
    boolean flag=false;
    if (eventTask != null && "String_Node_Str".equals(eventTask.getTaskName()) && msg.indexOf("String_Node_Str") == -1) {
      flag=true;
    }
    if (eventTask != null && "String_Node_Str".equals(eventTask.getTaskName())) {
      flag=true;
    }
    if (!flag) {
      printMessage(msg,out,priority);
    }
    logger.logInfo(msg);
  }
 else {
    if (eventTask != null && "String_Node_Str".equals(eventTask.getTaskName()) && msg.indexOf("String_Node_Str") == -1) {
      logger.logError(msg);
    }
 else {
      printMessage(msg,err,priority);
      logger.logError(msg);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param event event
 * @see org.apache.tools.ant.BuildListener#messageLogged(org.apache.tools.ant.BuildEvent)
 */
@Override public void messageLogged(final BuildEvent event){
  final int priority=event.getPriority();
  if (priority > msgOutputLevel) {
    return;
  }
  final StringBuffer message=new StringBuffer();
  final Task eventTask=event.getTask();
  if (eventTask != null) {
    final String label=new StringBuffer().append("String_Node_Str").append(eventTask.getTaskName()).append("String_Node_Str").toString();
    BufferedReader r=null;
    try {
      String line;
      boolean first=true;
      r=new BufferedReader(new StringReader(event.getMessage()));
      line=r.readLine();
      while (line != null) {
        if (!first) {
          message.append(StringUtils.LINE_SEP);
        }
        first=false;
        message.append(label).append(line);
        line=r.readLine();
      }
    }
 catch (    final IOException e) {
      message.append(label).append(event.getMessage());
    }
 finally {
      if (r != null) {
        try {
          r.close();
        }
 catch (        final IOException ioe) {
        }
      }
    }
  }
 else {
    message.append(event.getMessage());
  }
  final String msg=message.toString();
  catchHHCError(msg);
  if (priority != Project.MSG_ERR) {
    boolean flag=false;
    if (eventTask != null && "String_Node_Str".equals(eventTask.getTaskName()) && msg.indexOf("String_Node_Str") == -1) {
      flag=true;
    }
    if (eventTask != null && "String_Node_Str".equals(eventTask.getTaskName())) {
      flag=true;
    }
    if (!flag) {
      printMessage(msg,out,priority);
    }
    logger.logInfo(msg);
  }
 else {
    if (eventTask != null && "String_Node_Str".equals(eventTask.getTaskName()) && msg.indexOf("String_Node_Str") == -1) {
      logger.logError(msg);
    }
 else {
      printMessage(msg,err,priority);
      logger.logError(msg);
    }
  }
}