Skip to content

Commit 483202e

Browse files
committed
add comment
1 parent 33140d0 commit 483202e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,10 @@ public void update() throws IOException {
637637
try {
638638
if (terms != null) {
639639
uidIter = terms.iterator();
640-
TermsEnum.SeekStatus stat = uidIter.seekCeil(new BytesRef(startUid)); //init uid
640+
// The seekCeil() is pretty important because it makes uidIter.term() to become non-null.
641+
// Various indexer methods rely on this when working with the uidIter iterator - rather
642+
// than calling uidIter.next() first thing, they check uidIter.term().
643+
TermsEnum.SeekStatus stat = uidIter.seekCeil(new BytesRef(startUid));
641644
if (stat == TermsEnum.SeekStatus.END) {
642645
uidIter = null;
643646
LOGGER.log(Level.WARNING,

0 commit comments

Comments
 (0)