Program: 135001
Project: 135001
Buggy source:
/** 
 * Logs the given <code>LogRecord</code>.  The record can be modified or dropped by the optional filters provided in   {@link #addLogRecordFilter(alma.acs.logging.AcsLogger.LogRecordFilter)}.  <p> Adding of context information: <ul> <li> If the LogRecord has a parameter that is a map which contains additional information  about the line of code, thread, etc., the log record will be taken as provided, and no context information will be added. This can be useful if <ul> <li> the log record was reconstructed from a remote error by the ACS error handling code (see <code>AcsJException</code>), or <li> if in very exceptional cases application code needs to manipulate such information by hand. </ul> <li> otherwise, context information is inferred, similar to   {@link LogRecord#inferCaller()}, but additionally including thread name and line of code. </ul>   Note that by overloading this method, we intercept all logging activities of the base class.
 * @see java.util.logging.Logger#log(java.util.logging.LogRecord)
 */
public void log(LogRecord record){
  int levelValue=getLevel().intValue();
  if (record.getLevel().intValue() < levelValue || levelValue == offValue) {
    return;
  }
  if (loggerName != null) {
    record.setLoggerName(loggerName);
  }
  LogParameterExtractor paramExtractor=new LogParameterExtractor(record);
  String threadName=paramExtractor.extractStringProperty(LogParameterExtractor.PARAM_THREAD_NAME,null);
  if (threadName == null) {
    Map<String,Object> logProperties=new HashMap<String,Object>();
    record.setParameters(new Object[]{logProperties});
    threadName=Thread.currentThread().getName();
    logProperties.put(LogParameterExtractor.PARAM_THREAD_NAME,threadName);
    StackTraceElement stack[]=(new Throwable()).getStackTrace();
    int ix=0;
    while (ix < stack.length) {
      StackTraceElement frame=stack[ix];
      String cname=frame.getClassName();
      if (!loggerClassNames.contains(cname)) {
        record.setSourceClassName(cname);
        record.setSourceMethodName(frame.getMethodName());
        int lineNumber=frame.getLineNumber();
        logProperties.put(LogParameterExtractor.PARAM_LINE,new Long(lineNumber));
        break;
      }
      ix++;
    }
  }
  super.log(record);
}

Fixed version (ground truth):
/** 
 * Logs the given <code>LogRecord</code>.  The record can be modified or dropped by the optional filters provided in   {@link #addLogRecordFilter(alma.acs.logging.AcsLogger.LogRecordFilter)}.  <p> Adding of context information: <ul> <li> If the LogRecord has a parameter that is a map which contains additional information  about the line of code, thread, etc., the log record will be taken as provided, and no context information will be added. This can be useful if <ul> <li> the log record was reconstructed from a remote error by the ACS error handling code (see <code>AcsJException</code>), or <li> if in very exceptional cases application code needs to manipulate such information by hand. </ul> <li> otherwise, context information is inferred, similar to   {@link LogRecord#inferCaller()}, but additionally including thread name and line of code. </ul>   Note that by overloading this method, we intercept all logging activities of the base class.
 * @see java.util.logging.Logger#log(java.util.logging.LogRecord)
 */
public void log(LogRecord record){
  Logger loggerWithLevel=this;
  while (loggerWithLevel.getLevel() == null) {
    loggerWithLevel=loggerWithLevel.getParent();
  }
  int levelValue=loggerWithLevel.getLevel().intValue();
  if (record.getLevel().intValue() < levelValue || levelValue == offValue) {
    return;
  }
  if (loggerName != null) {
    record.setLoggerName(loggerName);
  }
  LogParameterExtractor paramExtractor=new LogParameterExtractor(record);
  String threadName=paramExtractor.extractStringProperty(LogParameterExtractor.PARAM_THREAD_NAME,null);
  if (threadName == null) {
    Map<String,Object> logProperties=new HashMap<String,Object>();
    record.setParameters(new Object[]{logProperties});
    threadName=Thread.currentThread().getName();
    logProperties.put(LogParameterExtractor.PARAM_THREAD_NAME,threadName);
    StackTraceElement stack[]=(new Throwable()).getStackTrace();
    int ix=0;
    while (ix < stack.length) {
      StackTraceElement frame=stack[ix];
      String cname=frame.getClassName();
      if (!loggerClassNames.contains(cname)) {
        record.setSourceClassName(cname);
        record.setSourceMethodName(frame.getMethodName());
        int lineNumber=frame.getLineNumber();
        logProperties.put(LogParameterExtractor.PARAM_LINE,new Long(lineNumber));
        break;
      }
      ix++;
    }
  }
  super.log(record);
}