Program: 14469
Project: 14469
Buggy source:
private FaultLogger initLogger(ComponentId componentId){
  final String targetLoggerName="String_Node_Str" + componentId.getName().toLowerCase() + "String_Node_Str";
  final String targetAppenderName=componentId.getName().toLowerCase() + "String_Node_Str";
  final String targetLogFileName=componentId.getName().toLowerCase() + "String_Node_Str";
  Logger logger=null;
  Enumeration logEnum=LogManager.getCurrentLoggers();
  while (logEnum.hasMoreElements()) {
    Logger currentLogger=(Logger)logEnum.nextElement();
    if (logger == null || currentLogger.getName().equals(targetLoggerName)) {
      logger=currentLogger;
    }
  }
  if (logger == null) {
    logger=Logger.getLogger(targetLoggerName);
    logger.setAdditivity(false);
    logger.setLevel(Level.FATAL);
  }
  Appender appender=checkAppender(LogManager.getRootLogger(),targetAppenderName);
  if (appender == null) {
    Enumeration logEnum2=LogManager.getCurrentLoggers();
    while (logEnum2.hasMoreElements()) {
      if (appender == null) {
        appender=checkAppender((Logger)logEnum.nextElement(),targetAppenderName);
      }
 else {
        break;
      }
    }
  }
  if (appender == null) {
    RollingFileAppender rAppender=new RollingFileAppender();
    rAppender.setFile(BaseDirectory.LOG.getChildFile(targetLogFileName).toString());
    rAppender.setMaxFileSize("String_Node_Str");
    rAppender.setMaxBackupIndex(10);
    rAppender.setLayout(new PatternLayout("String_Node_Str"));
    rAppender.setThreshold(Level.FATAL);
    rAppender.activateOptions();
    appender=rAppender;
  }
  if (checkAppender(logger,targetAppenderName) == null) {
    logger.addAppender(appender);
  }
  FaultLogger faultLogger=new XMLFaultLogger(logger);
  return faultLogger;
}

Fixed version (ground truth):
private FaultLogger initLogger(ComponentId componentId){
  final String targetLoggerName="String_Node_Str" + componentId.getName().toLowerCase() + "String_Node_Str";
  final String targetAppenderName=componentId.getName().toLowerCase() + "String_Node_Str";
  final String targetLogFileName=componentId.getName().toLowerCase() + "String_Node_Str";
  LOG.info("String_Node_Str" + targetLoggerName);
  Logger logger=null;
  Enumeration logEnum=LogManager.getCurrentLoggers();
  while (logEnum.hasMoreElements()) {
    Logger currentLogger=(Logger)logEnum.nextElement();
    if (logger == null && currentLogger.getName().equals(targetLoggerName)) {
      logger=currentLogger;
      LOG.info("String_Node_Str" + targetLoggerName);
      break;
    }
  }
  if (logger == null) {
    LOG.info("String_Node_Str" + targetLoggerName + "String_Node_Str");
    logger=Logger.getLogger(targetLoggerName);
    logger.setAdditivity(false);
    logger.setLevel(Level.FATAL);
  }
  LOG.info("String_Node_Str" + targetAppenderName);
  Appender appender=checkAppender(LogManager.getRootLogger(),targetAppenderName);
  if (appender == null) {
    logEnum=LogManager.getCurrentLoggers();
    while (logEnum.hasMoreElements()) {
      if (appender == null) {
        Logger currentLogger=(Logger)logEnum.nextElement();
        LOG.info("String_Node_Str" + currentLogger.getName() + "String_Node_Str"+ targetAppenderName);
        appender=checkAppender(currentLogger,targetAppenderName);
      }
 else {
        break;
      }
    }
  }
  if (appender == null) {
    RollingFileAppender rAppender=new RollingFileAppender();
    rAppender.setFile(BaseDirectory.LOG.getChildFile(targetLogFileName).toString());
    rAppender.setMaxFileSize("String_Node_Str");
    rAppender.setMaxBackupIndex(10);
    rAppender.setLayout(new PatternLayout("String_Node_Str"));
    rAppender.setThreshold(Level.FATAL);
    rAppender.activateOptions();
    rAppender.setName(targetAppenderName);
    appender=rAppender;
  }
  if (checkAppender(logger,targetAppenderName) == null) {
    logger.addAppender(appender);
  }
  FaultLogger faultLogger=new XMLFaultLogger(logger);
  return faultLogger;
}