Program: 134895
Project: 134895
Buggy source:
/** 
 * Enables loggers to send log records to the central ACS logger service. Tries to connect to the log service using the supplied ACS manager. As long as this connection fails, this method can sleep for 10 seconds and then try to connect again, if the parameter <code>retry</code> is <code>true</code>. Total retries are limited to 5, to detect a permanent problem before the log queue overflows. <p> Execution time can be significant, so consider calling this method in a separate thread  (which has no negative effect on the logging since all log records are cached and automatically sent off once the log service is available).  Use a daemon thread to avoid shutdown problems if this method still hangs in the login loop. <p> When the log service is obtained, the log queue used for remote logging will be flushed periodically  to the log service unless an otherwise triggered flush has done this already.  The default period is 10 seconds, but can be overridden in the CDB. <br>
 * @param orb  the ORB used in this JVM
 * @param manager  the ACS manager
 * @param managerHandle  handle assigned by the ACS Manager for this client
 * @param retry  if true, a failing connection to the log service will trigger up to 5 other attempts, every 10 seconds.
 * @return true if remote logging was initialized successfully
 * @see #shutdown(boolean)
 */
public boolean initRemoteLogging(ORB orb,Manager manager,int managerHandle,boolean retry){
  if (logDispatcher != null) {
    System.err.println("String_Node_Str");
    return false;
  }
  if (orb == null) {
    System.err.println("String_Node_Str");
    return false;
  }
  if (manager == null || managerHandle <= 0) {
    System.err.println("String_Node_Str" + managerHandle);
    return false;
  }
  LogOperations logService=null;
  int count=0;
  String errMsg;
  do {
    errMsg=null;
    count++;
    try {
      prepareRemoteLogging();
      logService=getLogService(manager,managerHandle);
      if (logService == null) {
        errMsg="String_Node_Str" + logServiceName + "String_Node_Str";
      }
 else {
        logQueueLock.lock();
        if (logQueue == null) {
          System.out.println("String_Node_Str");
          return false;
        }
        try {
          if (count > 1) {
            m_internalLogger.info("String_Node_Str");
          }
          if (LOG_BIN_TYPE) {
            logDispatcher=new RemoteLogDispatcher(orb,logService,new AcsBinLogFormatter());
          }
 else {
            logDispatcher=new RemoteLogDispatcher(orb,logService,new AcsXMLLogFormatter());
          }
          logQueue.setRemoteLogDispatcher(logDispatcher);
          logQueue.flushAllAndWait();
          logQueue.setPeriodicFlushing(flushPeriodSeconds * 1000);
        }
  finally {
          logQueueLock.unlock();
        }
      }
    }
 catch (    Throwable thr) {
      errMsg="String_Node_Str" + thr.toString();
      StackTraceElement[] trace=thr.getStackTrace();
      if (trace != null && trace.length > 0) {
        StackTraceElement traceOrigin=trace[0];
        errMsg+="String_Node_Str" + traceOrigin.getFileName() + "String_Node_Str"+ traceOrigin.getLineNumber();
      }
      errMsg+="String_Node_Str";
    }
    if (errMsg != null) {
      if (retry) {
        System.err.println(errMsg + "String_Node_Str");
        try {
          Thread.sleep(10000);
        }
 catch (        InterruptedException e) {
          System.err.println("String_Node_Str");
          retry=false;
        }
      }
 else {
        System.err.println(errMsg);
      }
    }
  }
 while (retry && count <= 5 && errMsg != null);
  return (errMsg == null);
}

Fixed version (ground truth):
/** 
 * Enables loggers to send log records to the central ACS logger service. Tries to connect to the log service using the supplied ACS manager. As long as this connection fails, this method can sleep for 10 seconds and then try to connect again, if the parameter <code>retry</code> is <code>true</code>. Total retries are limited to 5, to detect a permanent problem before the log queue overflows. <p> Execution time can be significant, so consider calling this method in a separate thread  (which has no negative effect on the logging since all log records are cached and automatically sent off once the log service is available).  Use a daemon thread to avoid shutdown problems if this method still hangs in the login loop. <p> When the log service is obtained, the log queue used for remote logging will be flushed periodically  to the log service unless an otherwise triggered flush has done this already.  The default period is 10 seconds, but can be overridden in the CDB. <br>
 * @param orb  the ORB used in this JVM
 * @param manager  the ACS manager
 * @param managerHandle  handle assigned by the ACS Manager for this client
 * @param retry  if true, a failing connection to the log service will trigger up to 5 other attempts, every 10 seconds.
 * @return true if remote logging was initialized successfully
 * @see #shutdown(boolean)
 */
public boolean initRemoteLogging(ORB orb,Manager manager,int managerHandle,boolean retry){
  if (logDispatcher != null) {
    System.err.println("String_Node_Str");
    return false;
  }
  if (orb == null) {
    System.err.println("String_Node_Str");
    return false;
  }
  if (manager == null || managerHandle <= 0) {
    System.err.println("String_Node_Str" + managerHandle);
    return false;
  }
  LogOperations logService=null;
  int count=0;
  String errMsg;
  do {
    errMsg=null;
    count++;
    try {
      prepareRemoteLogging();
      logService=getLogService(manager,managerHandle);
      if (logService == null) {
        errMsg="String_Node_Str" + logServiceName + "String_Node_Str";
      }
 else {
        logQueueLock.lock();
        try {
          if (logQueue == null) {
            System.out.println("String_Node_Str");
            return false;
          }
          if (count > 1) {
            m_internalLogger.info("String_Node_Str");
          }
          if (LOG_BIN_TYPE) {
            logDispatcher=new RemoteLogDispatcher(orb,logService,new AcsBinLogFormatter());
          }
 else {
            logDispatcher=new RemoteLogDispatcher(orb,logService,new AcsXMLLogFormatter());
          }
          logQueue.setRemoteLogDispatcher(logDispatcher);
          logQueue.flushAllAndWait();
          logQueue.setPeriodicFlushing(flushPeriodSeconds * 1000);
        }
  finally {
          logQueueLock.unlock();
        }
      }
    }
 catch (    Throwable thr) {
      errMsg="String_Node_Str" + thr.toString();
      StackTraceElement[] trace=thr.getStackTrace();
      if (trace != null && trace.length > 0) {
        StackTraceElement traceOrigin=trace[0];
        errMsg+="String_Node_Str" + traceOrigin.getFileName() + "String_Node_Str"+ traceOrigin.getLineNumber();
      }
      errMsg+="String_Node_Str";
    }
    if (errMsg != null) {
      if (retry) {
        System.err.println(errMsg + "String_Node_Str");
        try {
          Thread.sleep(10000);
        }
 catch (        InterruptedException e) {
          System.err.println("String_Node_Str");
          retry=false;
        }
      }
 else {
        System.err.println(errMsg);
      }
    }
  }
 while (retry && count <= 5 && errMsg != null);
  return (errMsg == null);
}