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

Matthew Swift
17.32.2013 f4de5503b5340cb28496253e58d176538d24dac5
Fix OPENDJ-1246: NPE while creating a new index

Don't register configuration change listener in constructor since the constructor is invoked during configuration validation as well as when applying the configuration change. Instead register the listener once the index has been opened, which is only done during backend init and when adding new indexes, and which is also symmetric with listener deregistration which is performed when closing indexes.
1 files modified
5 ■■■■■ changed files
opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java 5 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2013 ForgeRock AS
 */
package org.opends.server.backends.jeb;
import org.opends.messages.Message;
@@ -318,7 +318,6 @@
      extensibleIndexes.addQueryFactory(rule, factory);
      }
    }
    this.indexConfig.addChangeListener(this);
  }
  /**
@@ -361,6 +360,8 @@
        extensibleIndex.open();
      }
    }
    indexConfig.addChangeListener(this);
  }
  /**