You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2022/08/05 06:00:17 UTC

[GitHub] [lucenenet] vvdb-architecture commented on issue #271: TokenStream.IncrementToken() is called after Dispose() is called

vvdb-architecture commented on issue #271:
URL: https://github.com/apache/lucenenet/issues/271#issuecomment-1206074605

   Throwing exceptions in Dispose() is bad form.
   See https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1065
   Or https://docs.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?view=net-6.0:
   
   > If an object's [Dispose](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?view=net-6.0) method is called more than once, the object must ignore all calls after the first one. The object must not throw an exception if its [Dispose](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?view=net-6.0) method is called multiple times. Instance methods other than [Dispose](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable.dispose?view=net-6.0) can throw an [ObjectDisposedException](https://docs.microsoft.com/en-us/dotnet/api/system.objectdisposedexception?view=net-6.0) when resources are already disposed.


-- 
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: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org