Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING: Lucene.Net.Index.IndexWriter: Fixed Dispose(waitForMerges) vs Dispose(disposing) #749

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

NightOwl888
Copy link
Contributor

See #265.

Fixed Dispose() overloads so there is no method signature conflict between the public Dispose(waitForMerges) method and the protected Dispose(disposing) method which is meant for end users to override. This was done by adding a protected virtual void Dispose(bool disposing, bool waitForMerges) overload and removing virtual from the public Dispose(bool waitForMerges) overload.

This may break some existing code that either

  1. Subclasses IndexWriter and overrides the public virtual void Dispose(bool disposing) method. Instead, the subclass should override protected virtual void Dispose(bool disposing, bool waitForMerges).
  2. Subclasses IndexWriter and implements a finalizer, in which case the call should now call Dispose(disposing: false, waitForMerges: true). Previously, finalizers were not supported because there was no Dispose() overload to call to pass the disposing parameter.

…there is no method signature conflict between the public Dispose(waitForMerges) method and the protected Dispose(disposing) method that can be overridden and called from a finalizer. See apache#265.
@NightOwl888 NightOwl888 merged commit 649e178 into apache:master Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant