Program: 115913
Project: 115913
Buggy source:
private void addEventListeners(){
  addEventListener(new CompleteApplicationSignUpsEventListener(){
    @Override protected void onEvent(    Event event){
      if (log.isDebugEnabled()) {
        log.debug("String_Node_Str");
      }
      CompleteApplicationSignUpsEvent completeApplicationSignUpsEvent=(CompleteApplicationSignUpsEvent)event;
      for (      ApplicationSignUp applicationSignUp : completeApplicationSignUpsEvent.getApplicationSignUps()) {
        for (        String clusterId : applicationSignUp.getClusterIds()) {
          topologyProvider.addTenantSignUp(clusterId,applicationSignUp.getTenantId());
        }
        if (applicationSignUp.getDomainMappings() != null) {
          for (          DomainMapping domainMapping : applicationSignUp.getDomainMappings()) {
            if (domainMapping != null) {
              Cluster cluster=topologyProvider.getClusterByClusterId(domainMapping.getClusterId());
              if (cluster != null) {
                cluster.addHostName(domainMapping.getDomainName());
                log.info(String.format("String_Node_Str",cluster.getClusterId(),domainMapping.getDomainName()));
              }
            }
          }
        }
      }
    }
  }
);
  addEventListener(new ApplicationSignUpAddedEventListener(){
    @Override protected void onEvent(    Event event){
      ApplicationSignUpAddedEvent applicationSignUpAddedEvent=(ApplicationSignUpAddedEvent)event;
      for (      String clusterId : applicationSignUpAddedEvent.getClusterIds()) {
        topologyProvider.addTenantSignUp(clusterId,applicationSignUpAddedEvent.getTenantId());
      }
    }
  }
);
  addEventListener(new ApplicationSignUpRemovedEventListener(){
    @Override protected void onEvent(    Event event){
      ApplicationSignUpRemovedEvent applicationSignUpRemovedEvent=(ApplicationSignUpRemovedEvent)event;
      String applicationId=applicationSignUpRemovedEvent.getApplicationId();
      Application application=ApplicationManager.getApplications().getApplication(applicationId);
      if (application != null) {
        for (        ClusterDataHolder clusterDataHolder : application.getClusterDataMap().values())         topologyProvider.removeTenantSignUp(clusterDataHolder.getClusterId(),applicationSignUpRemovedEvent.getTenantId());
      }
    }
  }
);
}

Fixed version (ground truth):
private void addEventListeners(){
  addEventListener(new CompleteApplicationSignUpsEventListener(){
    private boolean initialized=false;
    @Override protected void onEvent(    Event event){
      try {
        if (initialized) {
          return;
        }
        if (log.isDebugEnabled()) {
          log.debug("String_Node_Str");
        }
        CompleteApplicationSignUpsEvent completeApplicationSignUpsEvent=(CompleteApplicationSignUpsEvent)event;
        for (        ApplicationSignUp applicationSignUp : completeApplicationSignUpsEvent.getApplicationSignUps()) {
          for (          String clusterId : applicationSignUp.getClusterIds()) {
            topologyProvider.addTenantSignUp(clusterId,applicationSignUp.getTenantId());
          }
          if (applicationSignUp.getDomainMappings() != null) {
            for (            DomainMapping domainMapping : applicationSignUp.getDomainMappings()) {
              if (domainMapping != null) {
                Cluster cluster=topologyProvider.getClusterByClusterId(domainMapping.getClusterId());
                if (cluster != null) {
                  cluster.addHostName(domainMapping.getDomainName());
                  log.info(String.format("String_Node_Str",cluster.getClusterId(),domainMapping.getDomainName()));
                }
              }
            }
          }
        }
        initialized=true;
      }
 catch (      Exception e) {
        log.error("String_Node_Str",e);
      }
    }
  }
);
  addEventListener(new ApplicationSignUpAddedEventListener(){
    @Override protected void onEvent(    Event event){
      try {
        ApplicationSignUpAddedEvent applicationSignUpAddedEvent=(ApplicationSignUpAddedEvent)event;
        for (        String clusterId : applicationSignUpAddedEvent.getClusterIds()) {
          topologyProvider.addTenantSignUp(clusterId,applicationSignUpAddedEvent.getTenantId());
        }
      }
 catch (      Exception e) {
        log.error("String_Node_Str",e);
      }
    }
  }
);
  addEventListener(new ApplicationSignUpRemovedEventListener(){
    @Override protected void onEvent(    Event event){
      try {
        ApplicationSignUpRemovedEvent applicationSignUpRemovedEvent=(ApplicationSignUpRemovedEvent)event;
        String applicationId=applicationSignUpRemovedEvent.getApplicationId();
        Application application=ApplicationManager.getApplications().getApplication(applicationId);
        if (application != null) {
          for (          ClusterDataHolder clusterDataHolder : application.getClusterDataMap().values())           topologyProvider.removeTenantSignUp(clusterDataHolder.getClusterId(),applicationSignUpRemovedEvent.getTenantId());
        }
      }
 catch (      Exception e) {
        log.error("String_Node_Str",e);
      }
    }
  }
);
}