Program: 167612
Project: 167612
Buggy source:
/** 
 * this method used to do some init thing before carrying message it will create some expensive big object so do NOT invoke it frequently
 * @throws MessagebusConnectedFailedException
 */
public synchronized void open() throws MessagebusConnectedFailedException {
  if (this.isOpen())   return;
  this.exchangeManager=new ExchangerManager(this.getPubsuberHost(),this.getPubsuberPort());
  if (!this.exchangeManager.isZKAlive())   throw new MessagebusConnectedFailedException("String_Node_Str");
  this.configManager=ConfigManager.getInstance();
  this.configManager.setExchangeManager(this.exchangeManager);
  this.exchangeManager.registerWithMultiChannels(this.appId,this.configManager,new String[]{CONSTS.PUBSUB_ROUTER_CHANNEL,CONSTS.PUBSUB_CONFIG_CHANNEL,CONSTS.PUBSUB_EVENT_CHANNEL,CONSTS.PUBSUB_AUTH_CHANNEL,CONSTS.PUBSUB_AUTH_SEND_PERMISSION_CHANNEL,CONSTS.PUBSUB_AUTH_RECEIVE_PERMISSION_CHANNEL});
  try {
    this.configManager.parseRealTimeData();
  }
 catch (  IOException e) {
    throw new MessagebusConnectedFailedException(e);
  }
  this.initConnection();
  boolean isAuthorized=this.doAuth();
  if (!isAuthorized)   throw new PermissionException("String_Node_Str" + this.appId + "String_Node_Str");
  this.useChannelPool=Boolean.valueOf(configManager.getClientConfigMap().get("String_Node_Str").getValue());
  if (this.useChannelPool) {
    this.initChannelPool();
  }
  GenericContext context=new GenericContext();
  context.setAppId(appId);
  context.setPool(this.pool);
  context.setConfigManager(this.configManager);
  context.setConnection(this.connection);
  ServiceLoader<IProducer> producerLoader=ServiceLoader.load(IProducer.class);
  producer=producerLoader.iterator().next();
  producer.setContext(context);
  ServiceLoader<IConsumer> consumerLoader=ServiceLoader.load(IConsumer.class);
  consumer=consumerLoader.iterator().next();
  consumer.setContext(context);
  ServiceLoader<IRequester> requestLoader=ServiceLoader.load(IRequester.class);
  requester=requestLoader.iterator().next();
  requester.setContext(context);
  ServiceLoader<IResponser> responseLoader=ServiceLoader.load(IResponser.class);
  responser=responseLoader.iterator().next();
  responser.setContext(context);
  ServiceLoader<IPublisher> publisherLoader=ServiceLoader.load(IPublisher.class);
  publisher=publisherLoader.iterator().next();
  publisher.setContext(context);
  ServiceLoader<ISubscriber> subscriberLoader=ServiceLoader.load(ISubscriber.class);
  subscriber=subscriberLoader.iterator().next();
  subscriber.setContext(context);
  ServiceLoader<IBroadcaster> broadcasterLoader=ServiceLoader.load(IBroadcaster.class);
  broadcaster=broadcasterLoader.iterator().next();
  broadcaster.setContext(context);
  boolean success=this.isOpen.compareAndSet(false,true);
  if (!success) {
    logger.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * this method used to do some init thing before carrying message it will create some expensive big object so do NOT invoke it frequently
 * @throws MessagebusConnectedFailedException
 */
public synchronized void open() throws MessagebusConnectedFailedException {
  if (this.isOpen())   return;
  this.exchangeManager=new ExchangerManager(this.getPubsuberHost(),this.getPubsuberPort());
  if (!this.exchangeManager.isZKAlive())   throw new MessagebusConnectedFailedException("String_Node_Str");
  this.configManager=ConfigManager.getInstance();
  this.configManager.setExchangeManager(this.exchangeManager);
  this.exchangeManager.registerWithMultiChannels(this.appId,this.configManager,new String[]{Constants.PUBSUB_ROUTER_CHANNEL,Constants.PUBSUB_CONFIG_CHANNEL,Constants.PUBSUB_EVENT_CHANNEL,Constants.PUBSUB_AUTH_CHANNEL,Constants.PUBSUB_AUTH_SEND_PERMISSION_CHANNEL,Constants.PUBSUB_AUTH_RECEIVE_PERMISSION_CHANNEL});
  try {
    this.configManager.parseRealTimeData();
  }
 catch (  IOException e) {
    throw new MessagebusConnectedFailedException(e);
  }
  this.initConnection();
  boolean isAuthorized=this.doAuth();
  if (!isAuthorized)   throw new PermissionException("String_Node_Str" + this.appId + "String_Node_Str");
  this.useChannelPool=Boolean.valueOf(configManager.getClientConfigMap().get("String_Node_Str").getValue());
  if (this.useChannelPool) {
    this.initChannelPool();
  }
  GenericContext context=new GenericContext();
  context.setAppId(appId);
  context.setPool(this.pool);
  context.setConfigManager(this.configManager);
  context.setConnection(this.connection);
  ServiceLoader<IProducer> producerLoader=ServiceLoader.load(IProducer.class);
  producer=producerLoader.iterator().next();
  producer.setContext(context);
  ServiceLoader<IConsumer> consumerLoader=ServiceLoader.load(IConsumer.class);
  consumer=consumerLoader.iterator().next();
  consumer.setContext(context);
  ServiceLoader<IRequester> requestLoader=ServiceLoader.load(IRequester.class);
  requester=requestLoader.iterator().next();
  requester.setContext(context);
  ServiceLoader<IResponser> responseLoader=ServiceLoader.load(IResponser.class);
  responser=responseLoader.iterator().next();
  responser.setContext(context);
  ServiceLoader<IPublisher> publisherLoader=ServiceLoader.load(IPublisher.class);
  publisher=publisherLoader.iterator().next();
  publisher.setContext(context);
  ServiceLoader<ISubscriber> subscriberLoader=ServiceLoader.load(ISubscriber.class);
  subscriber=subscriberLoader.iterator().next();
  subscriber.setContext(context);
  ServiceLoader<IBroadcaster> broadcasterLoader=ServiceLoader.load(IBroadcaster.class);
  broadcaster=broadcasterLoader.iterator().next();
  broadcaster.setContext(context);
  boolean success=this.isOpen.compareAndSet(false,true);
  if (!success) {
    logger.error("String_Node_Str");
  }
}