Skip to content

Commit 9db3846

Browse files
paulirwinclaude
andcommitted
Add breadcrumbs for assertEventQueueAfterClose and closeInternal removals, #1284
Upstream 2cfcdcc rewrote close(boolean) to delegate to shutdown(boolean) but kept assertEventQueueAfterClose() and closeInternal(boolean, boolean) as private dead code. The original #1284 port (7ec8790) dropped both, which matches trunk LUCENE-4246's eventual cleanup (8559eaf, Lucene 5.0) but diverges from the conservative branch_4x state at 2cfcdcc. Adds two LUCENENET breadcrumbs around ShouldClose() so a future porter diffing against 2cfcdcc can find the removal rationale at the position where each method used to live: - Full note before ShouldClose() covering both, since assertEventQueueAfterClose() sat there in upstream. - One-liner after ShouldClose() pointing back to the full note, since closeInternal() sat immediately after. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 08d82e8 commit 9db3846

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Lucene.Net/Index/IndexWriter.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,14 @@ private void Shutdown(bool waitForMerges)
12271227
}
12281228
}
12291229

1230+
// LUCENENET: upstream 2cfcdcc had private assertEventQueueAfterClose() between
1231+
// close(boolean) and shouldClose() (and closeInternal(boolean, boolean) immediately
1232+
// after shouldClose()). The LUCENE-5871 rewrite of close(boolean) stranded both as
1233+
// dead code: shutdown(boolean) replaced their only callers, and neither is referenced
1234+
// anywhere else in the file at 2cfcdcc. Trunk LUCENE-4246 (commit 8559eaf, Lucene 5.0)
1235+
// removed both alongside the rest of the close(boolean) cleanup; we follow that 5.0
1236+
// end state here rather than carrying the dead branch_4x leftovers.
1237+
12301238
/// <summary>
12311239
/// Returns <c>true</c> if this thread should attempt to close, or
12321240
/// false if IndexWriter is now closed; else, waits until
@@ -1266,6 +1274,9 @@ private bool ShouldClose()
12661274
}
12671275
}
12681276

1277+
// LUCENENET: upstream 2cfcdcc had private closeInternal(boolean waitForMerges,
1278+
// boolean doFlush) here. See the note above ShouldClose() for why it is dropped.
1279+
12691280
/// <summary>
12701281
/// Gets the <see cref="Store.Directory"/> used by this index. </summary>
12711282
public virtual Directory Directory => directory;

0 commit comments

Comments
 (0)