mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
12 hours ago df0af76ae6838013c0e66bf5d17c7e7aae44dac2
opendj-server-legacy/src/main/java/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -170,7 +170,6 @@
                                     ReferentialIntegrityPluginCfg pluginCfg)
         throws ConfigException
  {
    pluginCfg.addReferentialIntegrityChangeListener(this);
    LinkedList<LocalizableMessage> unacceptableReasons = new LinkedList<>();
    if (!isConfigurationAcceptableIgnoringCheckReferencesPluginTypes(pluginCfg, unacceptableReasons))
@@ -178,6 +177,10 @@
      throw new ConfigException(unacceptableReasons.getFirst());
    }
    // Only after the check: finalizePlugin() cannot remove a listener registered by a refused
    // configuration, because the configuration it removes it from is set in applyConfigurationChange().
    pluginCfg.addReferentialIntegrityChangeListener(this);
    // Enabling the plugin or changing its configuration is refused without these types, but a configuration
    // already stored without them (the entry shipped before issue #1118) is loaded with a warning: refusing
    // it would also stop the delete and modify DN clean-up, which does not need them.
@@ -928,6 +931,11 @@
  @Override
  public final void finalizePlugin() {
    if (currentConfiguration == null)
    {
      // initializePlugin() refused the configuration before registering anything.
      return;
    }
    currentConfiguration.removeReferentialIntegrityChangeListener(this);
    if(interval > 0)
    {