Program: 134875
Project: 134875
Buggy source:
/** 
 * This method gets a reference to the event channel. If it is not already registered with the naming service, it is created.
 * @return Reference to the event channel specified by channelName.
 * @param channelName Name of the event channel registered with the CORBA Naming Service
 * @param channelKind Kind of the channel as registered with the CORBA naming service ("channels").
 * @param notifyFactoryName Name of the notification service as registered with the CORBA naming service.
 * @throws AcsJException Standard ACS Java exception.
 */
public EventChannel getNotificationChannel(String channelName,String channelKind,String notifyFactoryName) throws AcsJException {
  EventChannel retValue=null;
  NameComponent[] t_NameSequence={new NameComponent(channelName,channelKind)};
  int retryNumberAttempts=20;
  int retrySleepSec=2;
  do {
    try {
      retValue=EventChannelHelper.narrow(getNamingService().resolve(t_NameSequence));
    }
 catch (    org.omg.CosNaming.NamingContextPackage.NotFound e) {
    }
catch (    org.omg.CosNaming.NamingContextPackage.CannotProceed e) {
      throw new AcsJUnexpectedExceptionEx(e);
    }
catch (    org.omg.CosNaming.NamingContextPackage.InvalidName e) {
      throw new AcsJUnexpectedExceptionEx(e);
    }
    if (retValue == null) {
      try {
        retValue=createNotificationChannel(channelName,channelKind,notifyFactoryName);
      }
 catch (      NameAlreadyUsed ex) {
        m_logger.log(Level.INFO,"String_Node_Str" + channelName + "String_Node_Str"+ retrySleepSec+ "String_Node_Str",ex);
        try {
          Thread.sleep(retrySleepSec * 1000);
        }
 catch (        InterruptedException ex1) {
        }
      }
catch (      NameMapError ex) {
        m_logger.log(Level.WARNING,"String_Node_Str",ex);
        try {
          Thread.sleep(retrySleepSec * 1000);
        }
 catch (        InterruptedException ex1) {
        }
      }
    }
  }
 while (retValue == null && --retryNumberAttempts >= 0);
  if (retValue == null) {
    AcsJGenericErrorEx ex=new AcsJGenericErrorEx();
    ex.setErrorDesc("String_Node_Str" + channelName);
    throw ex;
  }
  return retValue;
}

Fixed version (ground truth):
/** 
 * This method gets a reference to the event channel. If it is not already registered with the naming service, it is created.
 * @TODO Make "protected" again once we no longer have NC classes in separate subpackge "refactored".
 * @return Reference to the event channel specified by channelName.
 * @param channelName Name of the event channel registered with the CORBA Naming Service
 * @param channelKind Kind of the channel as registered with the CORBA naming service ("channels").
 * @param notifyFactoryName Name of the notification service as registered with the CORBA naming service.
 * @throws AcsJException Standard ACS Java exception.
 */
public EventChannel getNotificationChannel(String channelName,String channelKind,String notifyFactoryName) throws AcsJException {
  EventChannel retValue=null;
  NameComponent[] t_NameSequence={new NameComponent(channelName,channelKind)};
  int retryNumberAttempts=20;
  int retrySleepSec=2;
  do {
    try {
      retValue=EventChannelHelper.narrow(getNamingService().resolve(t_NameSequence));
    }
 catch (    org.omg.CosNaming.NamingContextPackage.NotFound e) {
    }
catch (    org.omg.CosNaming.NamingContextPackage.CannotProceed e) {
      throw new AcsJUnexpectedExceptionEx(e);
    }
catch (    org.omg.CosNaming.NamingContextPackage.InvalidName e) {
      throw new AcsJUnexpectedExceptionEx(e);
    }
    if (retValue == null) {
      try {
        retValue=createNotificationChannel(channelName,channelKind,notifyFactoryName);
      }
 catch (      NameAlreadyUsed ex) {
        m_logger.log(Level.INFO,"String_Node_Str" + channelName + "String_Node_Str"+ retrySleepSec+ "String_Node_Str",ex);
        try {
          Thread.sleep(retrySleepSec * 1000);
        }
 catch (        InterruptedException ex1) {
        }
      }
catch (      NameMapError ex) {
        m_logger.log(Level.WARNING,"String_Node_Str",ex);
        try {
          Thread.sleep(retrySleepSec * 1000);
        }
 catch (        InterruptedException ex1) {
        }
      }
    }
  }
 while (retValue == null && --retryNumberAttempts >= 0);
  if (retValue == null) {
    AcsJGenericErrorEx ex=new AcsJGenericErrorEx();
    ex.setErrorDesc("String_Node_Str" + channelName);
    throw ex;
  }
  return retValue;
}