Program: 134997
Project: 134997
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){
  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);
  }
  LogParameterUtil paramUtil=new LogParameterUtil(record);
  Map<String,Object> specialProperties=paramUtil.extractSpecialPropertiesMap();
  if (specialProperties == null) {
    specialProperties=LogParameterUtil.createPropertiesMap();
    record.setParameters(new Object[]{specialProperties});
    String threadName=Thread.currentThread().getName();
    specialProperties.put(LogParameterUtil.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();
        specialProperties.put(LogParameterUtil.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);
  }
  LogParameterUtil paramUtil=new LogParameterUtil(record);
  Map<String,Object> specialProperties=paramUtil.extractSpecialPropertiesMap();
  if (specialProperties == null) {
    specialProperties=LogParameterUtil.createPropertiesMap();
    List<Object> paramList=paramUtil.getNonSpecialPropertiesMapParameters();
    paramList.add(0,specialProperties);
    record.setParameters(paramList.toArray());
    String threadName=Thread.currentThread().getName();
    specialProperties.put(LogParameterUtil.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();
        specialProperties.put(LogParameterUtil.PARAM_LINE,new Long(lineNumber));
        break;
      }
      ix++;
    }
  }
  super.log(record);
}