Program: 27380
Project: 27380
Buggy source:
/** 
 * Initialize the processing part of the broker.
 * @param props the properties carrier where some props like port end host could be loaded.For the full list check of configurable properties check moquette.conf file.
 * @param embeddedObservers a list of callbacks to be notified of certain events inside the broker.Could be empty list of null.
 * @param authenticator an implementation of the authenticator to be used, if null load that specified in configand fallback on the default one (permit all).
 * @param authorizator an implementation of the authorizator to be used, if null load that specified in configand fallback on the default one (permit all).
 */
public ProtocolProcessor init(IConfig props,List<? extends InterceptHandler> embeddedObservers,IAuthenticator authenticator,IAuthorizator authorizator,Server server){
  subscriptions=new SubscriptionsStore();
  m_mapStorage=new MapDBPersistentStore(props);
  m_mapStorage.initStore();
  IMessagesStore messagesStore=m_mapStorage.messagesStore();
  m_sessionsStore=m_mapStorage.sessionsStore();
  List<InterceptHandler> observers=new ArrayList<>(embeddedObservers);
  String interceptorClassName=props.getProperty(BrokerConstants.INTERCEPT_HANDLER_PROPERTY_NAME);
  if (interceptorClassName != null && !interceptorClassName.isEmpty()) {
    try {
      InterceptHandler handler;
      try {
        final Constructor<? extends InterceptHandler> constructor=Class.forName(interceptorClassName).asSubclass(InterceptHandler.class).getConstructor(Server.class);
        handler=constructor.newInstance(server);
      }
 catch (      NoSuchMethodException nsme) {
        handler=Class.forName(interceptorClassName).asSubclass(InterceptHandler.class).newInstance();
      }
      observers.add(handler);
    }
 catch (    Throwable ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
  m_interceptor=new BrokerInterceptor(observers);
  subscriptions.init(m_sessionsStore);
  String configPath=System.getProperty("String_Node_Str",null);
  String authenticatorClassName=props.getProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME,"String_Node_Str");
  if (!authenticatorClassName.isEmpty()) {
    authenticator=(IAuthenticator)loadClass(authenticatorClassName,IAuthenticator.class,props);
    LOG.info("String_Node_Str",authenticatorClassName);
  }
  IResourceLoader resourceLoader=props.getResourceLoader();
  if (authenticator == null) {
    String passwdPath=props.getProperty(BrokerConstants.PASSWORD_FILE_PROPERTY_NAME,"String_Node_Str");
    if (passwdPath.isEmpty()) {
      authenticator=new AcceptAllAuthenticator();
    }
 else {
      authenticator=new ResourceAuthenticator(resourceLoader,passwdPath);
    }
  }
  String authorizatorClassName=props.getProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME,"String_Node_Str");
  if (!authorizatorClassName.isEmpty()) {
    authorizator=(IAuthorizator)loadClass(authorizatorClassName,IAuthorizator.class,props);
    LOG.info("String_Node_Str",authorizatorClassName);
  }
  if (authorizator == null) {
    String aclFilePath=props.getProperty(BrokerConstants.ACL_FILE_PROPERTY_NAME,"String_Node_Str");
    if (aclFilePath != null && !aclFilePath.isEmpty()) {
      authorizator=new DenyAllAuthorizator();
      try {
        authorizator=ACLFileParser.parse(resourceLoader.loadResource(aclFilePath));
      }
 catch (      ParseException pex) {
        LOG.error(String.format("String_Node_Str",resourceLoader.getName(),aclFilePath),pex);
      }
      LOG.info("String_Node_Str",aclFilePath);
    }
 else {
      authorizator=new PermitAllAuthorizator();
      LOG.info("String_Node_Str");
    }
  }
  boolean allowAnonymous=Boolean.parseBoolean(props.getProperty(BrokerConstants.ALLOW_ANONYMOUS_PROPERTY_NAME,"String_Node_Str"));
  boolean allowZeroByteClientId=Boolean.parseBoolean(props.getProperty(BrokerConstants.ALLOW_ZERO_BYTE_CLIENT_ID_PROPERTY_NAME,"String_Node_Str"));
  m_processor.init(subscriptions,messagesStore,m_sessionsStore,authenticator,allowAnonymous,allowZeroByteClientId,authorizator,m_interceptor,props.getProperty(BrokerConstants.PORT_PROPERTY_NAME));
  return m_processor;
}

Fixed version (ground truth):
/** 
 * Initialize the processing part of the broker.
 * @param props the properties carrier where some props like port end host could be loaded.For the full list check of configurable properties check moquette.conf file.
 * @param embeddedObservers a list of callbacks to be notified of certain events inside the broker.Could be empty list of null.
 * @param authenticator an implementation of the authenticator to be used, if null load that specified in configand fallback on the default one (permit all).
 * @param authorizator an implementation of the authorizator to be used, if null load that specified in configand fallback on the default one (permit all).
 * @param server the serber to init.
 * @return the processor created for the broker.
 */
public ProtocolProcessor init(IConfig props,List<? extends InterceptHandler> embeddedObservers,IAuthenticator authenticator,IAuthorizator authorizator,Server server){
  subscriptions=new SubscriptionsStore();
  m_mapStorage=new MapDBPersistentStore(props);
  m_mapStorage.initStore();
  IMessagesStore messagesStore=m_mapStorage.messagesStore();
  m_sessionsStore=m_mapStorage.sessionsStore();
  List<InterceptHandler> observers=new ArrayList<>(embeddedObservers);
  String interceptorClassName=props.getProperty(BrokerConstants.INTERCEPT_HANDLER_PROPERTY_NAME);
  if (interceptorClassName != null && !interceptorClassName.isEmpty()) {
    try {
      InterceptHandler handler;
      try {
        final Constructor<? extends InterceptHandler> constructor=Class.forName(interceptorClassName).asSubclass(InterceptHandler.class).getConstructor(Server.class);
        handler=constructor.newInstance(server);
      }
 catch (      NoSuchMethodException nsme) {
        handler=Class.forName(interceptorClassName).asSubclass(InterceptHandler.class).newInstance();
      }
      observers.add(handler);
    }
 catch (    Throwable ex) {
      LOG.error("String_Node_Str",ex);
    }
  }
  m_interceptor=new BrokerInterceptor(observers);
  subscriptions.init(m_sessionsStore);
  String configPath=System.getProperty("String_Node_Str",null);
  String authenticatorClassName=props.getProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME,"String_Node_Str");
  if (!authenticatorClassName.isEmpty()) {
    authenticator=(IAuthenticator)loadClass(authenticatorClassName,IAuthenticator.class,props);
    LOG.info("String_Node_Str",authenticatorClassName);
  }
  IResourceLoader resourceLoader=props.getResourceLoader();
  if (authenticator == null) {
    String passwdPath=props.getProperty(BrokerConstants.PASSWORD_FILE_PROPERTY_NAME,"String_Node_Str");
    if (passwdPath.isEmpty()) {
      authenticator=new AcceptAllAuthenticator();
    }
 else {
      authenticator=new ResourceAuthenticator(resourceLoader,passwdPath);
    }
  }
  String authorizatorClassName=props.getProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME,"String_Node_Str");
  if (!authorizatorClassName.isEmpty()) {
    authorizator=(IAuthorizator)loadClass(authorizatorClassName,IAuthorizator.class,props);
    LOG.info("String_Node_Str",authorizatorClassName);
  }
  if (authorizator == null) {
    String aclFilePath=props.getProperty(BrokerConstants.ACL_FILE_PROPERTY_NAME,"String_Node_Str");
    if (aclFilePath != null && !aclFilePath.isEmpty()) {
      authorizator=new DenyAllAuthorizator();
      try {
        authorizator=ACLFileParser.parse(resourceLoader.loadResource(aclFilePath));
      }
 catch (      ParseException pex) {
        LOG.error(String.format("String_Node_Str",resourceLoader.getName(),aclFilePath),pex);
      }
      LOG.info("String_Node_Str",aclFilePath);
    }
 else {
      authorizator=new PermitAllAuthorizator();
      LOG.info("String_Node_Str");
    }
  }
  boolean allowAnonymous=Boolean.parseBoolean(props.getProperty(BrokerConstants.ALLOW_ANONYMOUS_PROPERTY_NAME,"String_Node_Str"));
  boolean allowZeroByteClientId=Boolean.parseBoolean(props.getProperty(BrokerConstants.ALLOW_ZERO_BYTE_CLIENT_ID_PROPERTY_NAME,"String_Node_Str"));
  m_processor.init(subscriptions,messagesStore,m_sessionsStore,authenticator,allowAnonymous,allowZeroByteClientId,authorizator,m_interceptor,props.getProperty(BrokerConstants.PORT_PROPERTY_NAME));
  return m_processor;
}