OPENDJ-1262 NPE in ChangeNumberIndex during server startup
The problem was due to incorrect code factorization around cursor creation:
When creating the cursors, the startAfterCSN to use in different depending on where we come from:
- during ChangeNumberIndexer initialization, the cursors are already created from the previous cookie, so the provided CSN is the one to use
- on publishUpdateMsg(), we want the cursor to start exactly with the provided CSN, so we need to create the cursor with the immediately preceding CSN.
ChangeNumberIndexer.java:
In ensureCursorExists(), added boolean parameter startFromPrecedingCSN.
Added lots of comments.