paulirwin opened a new pull request, #1058:
URL: https://github.com/apache/lucenenet/pull/1058

   - [X] You've read the [Contributor 
Guide](https://github.com/apache/lucenenet/blob/main/CONTRIBUTING.md) and [Code 
of Conduct](https://www.apache.org/foundation/policies/conduct.html).
   - [X] You've included unit or integration tests for your change, where 
applicable.
   - [X] You've included inline docs for your change, where applicable.
   - [X] There's an open issue for the PR that you are making. If you'd like to 
propose a change, please [open an 
issue](https://github.com/apache/lucenenet/issues/new/choose) to discuss the 
change or find an existing issue.
   
   Overhaul TokenStream ICloseable/IDisposable Patterns
   
   Fixes #271
   
   ## Description
   
   This pull request focuses on refactoring the codebase by replacing the 
`Dispose` method with the new `ICloseable` interface's `Close` method in all 
provided TokenStream implementations to make them reusable. None of the 
implementations in our codebase need a non-reusable cleanup method, however, in 
discussion in #271, it was determined that there are possible use cases in 
which a custom TokenStream implementation might need to have their instance 
Disposed when the owning Analyzer (with stored values set by a ReuseStrategy) 
is disposed, so we have retained the IDisposable pattern as well. This PR also 
ensures that those values are disposed by way of DisposableThreadLocal and 
TokenStreamComponents disposing of their values.
   
   Remaining draft PR TODOs:
   - [ ] Make `PrefixTreeStrategy.CellTokenStream` reusable
   - [ ] Make `MemoryIndex.TokenStreamAnonymousClass<T>` reusable
   - [ ] Determine if we can fix the failing test in #271
   - [ ] Split out any other requirements as separate issues if possible (or 
include here)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to