NightOwl888 commented on code in PR #801: URL: https://github.com/apache/lucenenet/pull/801#discussion_r1160887541
########## src/Lucene.Net.Suggest/Spell/SpellChecker.cs: ########## @@ -142,8 +142,9 @@ public SpellChecker(Directory spellIndex, IStringDistance sd, IComparer<SuggestW /// <param name="spellIndexDir"> the spell directory to use </param> /// <exception cref="ObjectDisposedException"> if the Spellchecker is already closed </exception> /// <exception cref="IOException"> if spellchecker can not open the directory </exception> - // TODO: we should make this final as it is called in the constructor - public virtual void SetSpellIndex(Directory spellIndexDir) + // LUCENENET specific - S1699 - marked non-virtual because calling + // virtual members from the constructor is not a safe operation in .NET + public void SetSpellIndex(Directory spellIndexDir) Review Comment: I was thinking this one is a good candidate for `LazyInitializer`. Then I saw the comment that was added by the Lucene team: ```c# // TODO: we should make this final as it is called in the constructor ``` I checked and as of Lucene 9.5.0 they still haven't changed that. But being that they intend to, I think we can keep this change. -- 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-unsubscr...@lucenenet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org